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