You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
12 KiB

9 years ago
9 years ago
  1. /*!
  2. * # Semantic UI 1.10.3 - Transition
  3. * http://github.com/semantic-org/semantic-ui/
  4. *
  5. *
  6. * Copyright 2014 Contributors
  7. * Released under the MIT license
  8. * http://opensource.org/licenses/MIT
  9. *
  10. */
  11. !function(n,i,e,t){"use strict";n.fn.transition=function(){{var a,o=n(this),s=o.selector||"",r=(new Date).getTime(),l=[],d=arguments,m=d[0],c=[].slice.call(arguments,1),u="string"==typeof m;i.requestAnimationFrame||i.mozRequestAnimationFrame||i.webkitRequestAnimationFrame||i.msRequestAnimationFrame||function(n){setTimeout(n,0)}}return o.each(function(i){var f,g,p,v,b,y,h,w,C,A,T,S=n(this),x=this;T={initialize:function(){f=T.get.settings.apply(x,d),v=f.className,p=f.error,b=f.metadata,A="."+f.namespace,C="module-"+f.namespace,g=S.data(C)||T,h=T.get.animationEndEvent(),w=T.get.animationName(),y=T.get.animationStartEvent(),u&&(u=T.invoke(m)),u===!1&&(T.verbose("Converted arguments into settings object",f),f.interval?T.delay(f.animate):T.animate(),T.instantiate())},instantiate:function(){T.verbose("Storing instance of module",T),g=T,S.data(C,g)},destroy:function(){T.verbose("Destroying previous module for",x),S.removeData(C)},refresh:function(){T.verbose("Refreshing display type on next animation"),delete T.displayType},forceRepaint:function(){T.verbose("Forcing element repaint");var n=S.parent(),i=S.next();0===i.length?S.detach().appendTo(n):S.detach().insertBefore(i)},repaint:function(){T.verbose("Repainting element");x.offsetWidth},delay:function(n){var e,a=f.reverse===!0,s="auto"==f.reverse&&T.get.direction()==v.outward;n=typeof n!==t?n:f.interval,e=a||s?(o.length-i)*f.interval:i*f.interval,T.debug("Delaying animation by",e),setTimeout(T.animate,e)},animate:function(n){if(f=n||f,!T.is.supported())return T.error(p.support),!1;if(T.debug("Preparing animation",f.animation),T.is.animating()){if(f.queue)return!f.allowRepeats&&T.has.direction()&&T.is.occurring()&&T.queuing!==!0?T.debug("Animation is currently occurring, preventing queueing same animation",f.animation):T.queue(f.animation),!1;if(!f.allowRepeats&&T.is.occurring())return T.debug("Animation is already occurring, will not execute repeated animation",f.animation),!1}T.can.animate()?T.set.animating(f.animation):T.error(p.noAnimation,f.animation,x)},reset:function(){T.debug("Resetting animation to beginning conditions"),T.remove.animationEndCallback(),T.restore.conditions(),T.remove.animating()},queue:function(n){T.debug("Queueing animation of",n),T.queuing=!0,S.one(h+A,function(){T.queuing=!1,T.repaint(),T.animate.apply(this,f)})},complete:function(){T.verbose("CSS animation complete",f.animation),T.remove.animationEndCallback(),T.remove.failSafe(),T.is.looping()||(T.is.outward()?(T.verbose("Animation is outward, hiding element"),T.restore.conditions(),T.hide(),f.onHide.call(this)):T.is.inward()?(T.verbose("Animation is outward, showing element"),T.restore.conditions(),T.show(),T.set.display(),f.onShow.call(this)):T.restore.conditions(),T.remove.animation(),T.remove.animating()),f.onComplete.call(this)},has:{direction:function(i){var e=!1;return i=i||f.animation,"string"==typeof i&&(i=i.split(" "),n.each(i,function(n,i){(i===v.inward||i===v.outward)&&(e=!0)})),e},inlineDisplay:function(){var i=S.attr("style")||"";return n.isArray(i.match(/display.*?;/,""))}},set:{animating:function(n){n=n||f.animation,T.is.animating()||T.save.conditions(),T.remove.direction(),T.remove.animationEndCallback(),T.can.transition()&&!T.has.direction()&&T.set.direction(),T.remove.hidden(),T.set.display(),S.addClass(v.animating+" "+v.transition+" "+n).addClass(n).one(h+".complete"+A,T.complete),f.useFailSafe&&T.add.failSafe(),T.set.duration(f.duration),f.onStart.call(this),T.debug("Starting tween",n,S.attr("class"))},duration:function(n,i){i=i||f.duration,i="number"==typeof i?i+"ms":i,T.verbose("Setting animation duration",i),(i||0===i)&&S.css({"-webkit-animation-duration":i,"-moz-animation-duration":i,"-ms-animation-duration":i,"-o-animation-duration":i,"animation-duration":i})},display:function(){var n=T.get.style(),i=T.get.displayType(),e=n+"display: "+i+" !important;";S.css("display",""),T.refresh(),S.css("display")!==i&&(T.verbose("Setting inline visibility to",i),S.attr("style",e))},direction:function(){S.is(":visible")&&!T.is.hidden()?(T.debug("Automatically determining the direction