1 goog.provide('lime.transitions.Dissolve'); 2 3 goog.require('lime.animation.FadeTo'); 4 goog.require('lime.transitions.Transition'); 5 6 /** 7 * Dissolve transition 8 * @inheritDoc 9 * @extends lime.transitions.Transition 10 * @constructor 11 */ 12 lime.transitions.Dissolve = function(outgoing, incoming) { 13 lime.transitions.Transition.call(this, outgoing, incoming); 14 }; 15 goog.inherits(lime.transitions.Dissolve, lime.transitions.Transition); 16 17 18 /** @inheritDoc */ 19 lime.transitions.Dissolve.prototype.start = function() { 20 this.incoming_.setOpacity(0); 21 this.incoming_.setHidden(false); 22 var hide = new lime.animation.FadeTo(0).setDuration(this.getDuration()).enableOptimizations(); 23 24 goog.events.listen(hide, lime.animation.Event.STOP, function() { 25 if (this.outgoing_) { 26 this.outgoing_.setOpacity(1); 27 } 28 },false, this); 29 30 if (this.outgoing_) 31 this.outgoing_.runAction(hide); 32 33 var show = new lime.animation.FadeTo(1).setDuration(this.getDuration()); 34 this.incoming_.runAction(show); 35 36 goog.events.listen(show, lime.animation.Event.STOP, 37 this.finish, false, this); 38 39 40 }; 41 42 43 44