This repository has been archived on 2024-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
calcifer/web/semantic/dist/components/transition.min.js

11 lines
13 KiB
JavaScript
Raw Normal View History

2015-03-29 19:33:23 +02:00
/*!
* # Semantic UI 1.11.4 - Transition
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2014 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
!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,m=u[0],c=[].slice.call(arguments,1),d="string"==typeof m;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,w,C,A,T,S=n(this),x=this;T={initialize:function(){f=T.get.settings.apply(x,u),v=f.className,g=f.error,b=f.metadata,A="."+f.namespace,C="module-"+f.namespace,p=S.data(C)||T,h=T.get.animationEndEvent(),w=T.get.animationName(),y=T.get.animationStartEvent(),d&&(d=T.invoke(m)),d===!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),p=T,S.data(C,p)},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(),e=S.next();0===e.length?S.detach().appendTo(n):S.detach().insertBefore(e)},repaint:function(){T.verbose("Repainting element");x.offsetWidth},delay:function(n){var i,a=f.reverse===!0,s="auto"==f.reverse&&T.get.direction()==v.outward;n=typeof n!==t?n:f.interval,i=a||s?(o.length-e)*f.interval:e*f.interval,T.debug("Delaying animation by",i),setTimeout(T.animate,i)},animate:function(n){if(f=n||f,!T.is.supported())return T.error(g.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.debug("New animation started, completing previous early",f.animation),T.complete()}T.can.animate()?T.set.animating(f.animation):T.error(g.noAnimation,f.animation,x)},reset:function(){T.debug("Resetting animation to beginning conditions"),T.remove.animationCallbacks(),T.restore.conditions(),T.remove.animating()},queue:function(n){T.debug("Queueing animation of",n),T.queuing=!0,S.one(h+".queue"+A,function(){T.queuing=!1,T.repaint(),T.animate.apply(this,f)})},complete:function(){T.debug("Animation complete",f.animation),T.remove.completeCallback(),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(),f.onShow.call(this)):T.restore.conditions(),T.remove.animation(),T.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=S.attr("style")||"";return n.isArray(e.match(/display.*?;/,""))}},set:{animating:function(n){n=n||f.animation,T.is.animating()||T.save.conditions(),T.remove.direction(),T.remove.completeCallback(),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,e){e=e||f.duration,e="number"==typeof e?e+"ms":e,(e||0===e)&&(T.verbose("Setting animation duration",e),S.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(),e=T.get.displayType(),i=n+"display: "+e+" !important;";S.css("display",""),T.refresh(),S.css("display")!==e&&(T.verbose("Setting inline visibility to",e),S.attr("style",i))},direction:function(){S.is(":visible")&&