|
|
/* * # Semantic UI * git://github.com/Semantic-Org/Semantic-UI.git#1.0
* * * Copyright 2014 Contributors * Released under the MIT license * http://opensource.org/licenses/MIT
* */ !function(n,i,e,t){"use strict";n.fn.transition=function(){{var a,o=n(this),s=o.selector||"",r=(new Date).getTime(),d=[],c=arguments,l=c[0],m=[].slice.call(arguments,1),u="string"==typeof l;i.requestAnimationFrame||i.mozRequestAnimationFrame||i.webkitRequestAnimationFrame||i.msRequestAnimationFrame||function(n){setTimeout(n,0)}}return o.each(function(){var i,p,f,g,v,b,y,h,w,C,T,A=n(this),x=this;T={initialize:function(){w="module-"+h,i=T.get.settings.apply(x,c),g=i.className,v=i.metadata,b=T.get.animationEvent(),y=T.get.animationName(),f=i.error,h=i.namespace,C="."+i.namespace,p=A.data(w)||T,u&&(u=T.invoke(l)),u===!1&&(T.verbose("Converted arguments into settings object",i),T.animate(),T.instantiate())},instantiate:function(){T.verbose("Storing instance of module",T),A.data(w,p)},destroy:function(){T.verbose("Destroying previous module for",x),A.removeData(w)},refresh:function(){T.verbose("Refreshing display type on next animation"),delete T.displayType},forceRepaint:function(){T.verbose("Forcing element repaint");var n=A.parent(),i=A.next();0===i.size()?A.detach().appendTo(n):A.detach().insertBefore(i)},repaint:function(){T.verbose("Repainting element");x.offsetWidth},animate:function(n){return i=n||i,T.is.supported()?(T.debug("Preparing animation",i.animation),T.is.animating()&&i.queue?(!i.allowRepeats&&T.has.direction()&&T.is.occuring()&&T.queuing!==!0?T.error(f.repeated,i.animation,A):T.queue(i.animation),!1):void(T.can.animate?T.set.animating(i.animation):T.error(f.noAnimation,i.animation))):(T.error(f.support),!1)},reset:function(){T.debug("Resetting animation to beginning conditions"),A.off(b+C),T.restore.conditions(),T.hide(),T.remove.animating()},queue:function(n){T.debug("Queueing animation of",n),T.queuing=!0,A.one(b+C,function(){T.queuing=!1,T.repaint(),T.animate.apply(this,i)})},complete:function(){T.verbose("CSS animation complete",i.animation),T.is.looping()||(T.is.outward()?(T.verbose("Animation is outward, hiding element"),T.restore.conditions(),T.remove.display(),T.hide(),n.proxy(i.onHide,this)()):T.is.inward()?(T.verbose("Animation is outward, showing element"),T.restore.conditions(),T.set.display(),T.show(),n.proxy(i.onShow,this)()):T.restore.conditions(),T.remove.duration(),T.remove.animating()),n.proxy(i.complete,this)()},has:{direction:function(n){return n=n||i.animation,-1!==n.search(g.inward)||-1!==n.search(g.outward)?(T.debug("Direction already set in animation"),!0):!1}},set:{animating:function(e){e=e||i.animation,T.is.animating()||T.save.conditions(),T.remove.direction(),A.off(".complete"),T.can.transition()&&!T.has.direction()&&T.set.direction(),T.remove.hidden(),T.set.display(),A.addClass(g.animating).addClass(g.transition).addClass(e).one(b+".complete"+C,T.complete),T.set.duration(i.duration),n.proxy(i.start,this)(),T.debug("Starting tween",e,A.attr("class"))},display:function(){var n=T.get.style(),i=T.get.displayType(),e=n+"display: "+i+" !important;";A.css("display")!==i&&(T.verbose("Setting inline visibility to",i),A.attr("style",e))},direction:function(){A.is(":visible")&&!T.is.hidden()?(T.debug("Automatically determining the direction of animation","Outward"),A.removeClass(g.inward).addClass(g.outward)):(T.debug("Automatically determining the direction of animation","Inward"),A.removeClass(g.outward).addClass(g.inward))},looping:function(){T.debug("Transition set to loop"),A.addClass(g.looping)},duration:function(n){n=n||i.duration,n="number"==typeof n?n+"ms":n,T.verbose("Setting animation duration",n),A.css({"-webkit-animation-duration":n,"-moz-animation-duration":n,"-ms-animation-duration":n,"-o-animation-duration":n,"animation-duration":n})},hidden:function(){T.is.hidden()||(A.addClass(g.transition).addClass(g.hidden),"none"!==A.css("display")&&(T.verbose("Overriding default display to hide element"),A.css("display","none")))},visible:function(){A.addClass(g.transition).addClass(g.visible)}},save:{displayType:function(n){T.displayType=n},transitionExists:function(i,e){n.fn.transition.exists[i]=e,T.verbose("Saving existence of transition",i,e)},conditions:function(){A.attr("class")||
|