|
|
/* * # Semantic UI * https://github.com/Semantic-Org/Semantic-UI
* http://beta.semantic-ui.com/
* * 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=[],l=arguments,c=l[0],m=[].slice.call(arguments,1),u="string"==typeof c;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,C,w,T,A=n(this),x=this;T={initialize:function(){C="module-"+h,i=T.get.settings.apply(x,l),g=i.className,v=i.metadata,b=T.get.animationEvent(),y=T.get.animationName(),f=i.error,h=i.namespace,w="."+i.namespace,p=A.data(C)||T,u&&(u=T.invoke(c)),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(C,p)},destroy:function(){T.verbose("Destroying previous module for",x),A.removeData(C)},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+w),T.restore.conditions(),T.hide(),T.remove.animating()},queue:function(n){T.debug("Queueing animation of",n),T.queuing=!0,A.one(b+w,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.hide(),T.remove.display(),n.proxy(i.onHide,this)()):T.is.inward()?(T.verbose("Animation is outward, showing element"),T.restore.conditions(),T.show(),T.set.display(),n.proxy(i.onShow,this)()):T.restore.conditions(),T.remove.animation(),T.remove.animating()),n.proxy(i.onComplete,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"+w,T.complete),T.set.duration(i.duration),n.proxy(i.onStart,this)(),T.debug("Starting tween",e,A.attr("class"))},duration:function(n,e){e=e||i.duration,e="number"==typeof e?e+"ms":e,T.verbose("Setting animation duration",e),A.css({"-webkit-animation-duration":e,"-moz-animation-duration":e,"-ms-animation-duration":e,"-o-animation-duration":e,"animation-duration":e})},display:function(){var n=T.get.style(),i=T.get.displayType(),e=n+"display: "+i+" !important;";T.refresh(),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)},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){A.data(v.displayType,n)},transitionExists:function(i,e){n.fn.transition.exists[i]=e,T.verbose("Saving existence of transition",i,e)},conditions:f
|