src/cm/media/js/client/c_icomment.js
changeset 329 00df963f91fb
parent 294 c2c262ac1273
child 330 db7616686c57
equal deleted inserted replaced
328:2a6033ca510e 329:00df963f91fb
   421 		}
   421 		}
   422 		gIComments.signalAnimationEnd() ;
   422 		gIComments.signalAnimationEnd() ;
   423 		if (gIComments.animationsEnded())
   423 		if (gIComments.animationsEnded())
   424 			gIComments.whenAnimationsEnd() ;		
   424 			gIComments.whenAnimationsEnd() ;		
   425 	},
   425 	},
       
   426 	onAnimationEndFocus : function() {
       
   427 		if (!CY.Lang.isUndefined(this['animation-handle']) && !CY.Lang.isNull(this['animation-handle'])) { 
       
   428 			this['animation-handle'].detach() ;
       
   429 			this['animation-handle'] = null ;
       
   430 //			CY.log('detached...') ;
       
   431 		}
       
   432 		gIComments.signalAnimationEnd() ;
       
   433 		if (gIComments.animationsEnded())
       
   434 			gIComments.whenAnimationsEndFocus() ;		
       
   435 	},
   426 
   436 
   427 	//aa = new CY.Anim({node:gIComments._c[0].overlay.get('boundingBox'), to:{xy : [0,0]}, duration:2.0})
   437 	//aa = new CY.Anim({node:gIComments._c[0].overlay.get('boundingBox'), to:{xy : [0,0]}, duration:2.0})
   428 	setAnimationToPosition : function(toXY) {
   438 	setAnimationToPosition : function(toXY, focus) {
   429 		var boundingBoxNode = this.overlay.get('boundingBox') ;
   439 		var boundingBoxNode = this.overlay.get('boundingBox') ;
   430 		
   440 		
   431 		// ANIMATION
   441 		// ANIMATION
   432 	    // 2 lines of optim that could be removed (0.011)
   442 	    // 2 lines of optim that could be removed (0.011)
   433 		if (gPrefs.get('general','animduration') < 0.011) 
   443 		if (gPrefs.get('general','animduration') < 0.011) 
   434 	    	boundingBoxNode.setXY(toXY) ;
   444 	    	boundingBoxNode.setXY(toXY) ;
   435 		
   445 		
   436 		this.animation.set('to', { xy: toXY});
   446 		this.animation.set('to', { xy: toXY});
   437 		this.animation.set('duration', gPrefs.get('general','animduration')) ; // shouldn't be here really ...
   447 		this.animation.set('duration', gPrefs.get('general','animduration')) ; // shouldn't be here really ...
   438 		this['animation-handle'] = this.animation.on('end', this.onAnimationEnd, this);
   448     if (focus)
       
   449     	this['animation-handle'] = this.animation.on('end', this.onAnimationEndFocus, this);
       
   450     	this['animation-handle'] = this.animation.on('end', this.onAnimationEnd, this);
   439 		
   451 		
   440 		return this.animation ;
   452 		return this.animation ;
   441 	},
   453 	},
   442 	getHeight : function() {
   454 	getHeight : function() {
   443 		return this.overlay.get('boundingBox').get('offsetHeight') ;
   455 		return this.overlay.get('boundingBox').get('offsetHeight') ;