431 } |
431 } |
432 gIComments.signalAnimationEnd() ; |
432 gIComments.signalAnimationEnd() ; |
433 if (gIComments.animationsEnded()) |
433 if (gIComments.animationsEnded()) |
434 gIComments.whenAnimationsEndFocus() ; |
434 gIComments.whenAnimationsEndFocus() ; |
435 }, |
435 }, |
|
436 onAnimationEndReply : function() { |
|
437 if (!CY.Lang.isUndefined(this['animation-handle']) && !CY.Lang.isNull(this['animation-handle'])) { |
|
438 this['animation-handle'].detach() ; |
|
439 this['animation-handle'] = null ; |
|
440 // CY.log('detached...') ; |
|
441 } |
|
442 gIComments.signalAnimationEnd() ; |
|
443 //if (gIComments.animationsEnded()) |
|
444 gIComments.whenAnimationsEndReply() ; |
|
445 }, |
436 |
446 |
437 //aa = new CY.Anim({node:gIComments._c[0].overlay.get('boundingBox'), to:{xy : [0,0]}, duration:2.0}) |
447 //aa = new CY.Anim({node:gIComments._c[0].overlay.get('boundingBox'), to:{xy : [0,0]}, duration:2.0}) |
438 setAnimationToPosition : function(toXY, focus) { |
448 setAnimationToPosition : function(toXY, focus, reply) { |
439 var boundingBoxNode = this.overlay.get('boundingBox') ; |
449 var boundingBoxNode = this.overlay.get('boundingBox') ; |
440 |
450 |
441 // ANIMATION |
451 // ANIMATION |
442 // 2 lines of optim that could be removed (0.011) |
452 // 2 lines of optim that could be removed (0.011) |
443 if (gPrefs.get('general','animduration') < 0.011) |
453 if (gPrefs.get('general','animduration') < 0.011) |
444 boundingBoxNode.setXY(toXY) ; |
454 boundingBoxNode.setXY(toXY) ; |
445 |
455 |
446 this.animation.set('to', { xy: toXY}); |
456 this.animation.set('to', { xy: toXY}); |
447 this.animation.set('duration', gPrefs.get('general','animduration')) ; // shouldn't be here really ... |
457 this.animation.set('duration', gPrefs.get('general','animduration')) ; // shouldn't be here really ... |
448 if (focus) |
458 if (focus) |
449 this['animation-handle'] = this.animation.on('end', this.onAnimationEndFocus, this); |
459 if (reply) |
|
460 this['animation-handle'] = this.animation.on('end', this.onAnimationEndReply, this); |
|
461 else |
|
462 this['animation-handle'] = this.animation.on('end', this.onAnimationEndFocus, this); |
450 else |
463 else |
451 this['animation-handle'] = this.animation.on('end', this.onAnimationEnd, this); |
464 this['animation-handle'] = this.animation.on('end', this.onAnimationEnd, this); |
452 |
465 |
453 return this.animation ; |
466 return this.animation ; |
454 }, |
467 }, |