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
13 KiB

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