|
|
/* * # Semantic UI * git://github.com/Semantic-Org/Semantic-UI.git
* * * Copyright 2014 Contributors * Released under the MIT license * http://opensource.org/licenses/MIT
* */ !function(e,t,i,n){"use strict";e.fn.shape=function(a){var o,r=e(this),s=e("body"),d=(new Date).getTime(),u=[],c=arguments[0],l="string"==typeof c,g=[].slice.call(arguments,1),f=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return r.each(function(){var t,m,p,h=r.selector||"",v=e.extend(!0,{},e.fn.shape.settings,a),b=v.namespace,x=v.selector,y=v.error,z=v.className,C="."+b,W="module-"+b,S=e(this),w=S.find(x.sides),k=S.find(x.side),T=!1,E=this,F=S.data(W);p={initialize:function(){p.verbose("Initializing module for",E),p.set.defaultSide(),p.instantiate()},instantiate:function(){p.verbose("Storing instance of module",p),F=p,S.data(W,F)},destroy:function(){p.verbose("Destroying previous module for",E),S.removeData(W).off(C)},refresh:function(){p.verbose("Refreshing selector cache for",E),S=e(E),w=e(this).find(x.shape),k=e(this).find(x.side)},repaint:function(){p.verbose("Forcing repaint event");{var e=w.get(0)||i.createElement("div");e.offsetWidth}},animate:function(i,a){p.verbose("Animating box with properties",i),a=a||function(e){p.verbose("Executing animation callback"),e!==n&&e.stopPropagation(),p.reset(),p.set.active()},e.proxy(v.beforeChange,m[0])(),p.get.transitionEvent()?(p.verbose("Starting CSS animation"),S.addClass(z.animating),w.css(i).one(p.get.transitionEvent(),a),p.set.duration(v.duration),f(function(){S.addClass(z.animating),t.addClass(z.hidden)})):a()},queue:function(e){p.debug("Queueing animation of",e),w.one(p.get.transitionEvent(),function(){p.debug("Executing queued animation"),setTimeout(function(){S.shape(e)},0)})},reset:function(){p.verbose("Animating states reset"),S.removeClass(z.animating).attr("style","").removeAttr("style"),w.attr("style","").removeAttr("style"),k.attr("style","").removeAttr("style").removeClass(z.hidden),m.removeClass(z.animating).attr("style","").removeAttr("style")},is:{animating:function(){return S.hasClass(z.animating)}},set:{defaultSide:function(){t=S.find("."+v.className.active),m=t.next(x.side).size()>0?t.next(x.side):S.find(x.side).first(),T=!1,p.verbose("Active side set to",t),p.verbose("Next side set to",m)},duration:function(e){e=e||v.duration,e="number"==typeof e?e+"ms":e,p.verbose("Setting animation duration",e),w.add(k).css({"-webkit-transition-duration":e,"-moz-transition-duration":e,"-ms-transition-duration":e,"-o-transition-duration":e,"transition-duration":e})},stageSize:function(){var e=S.clone().addClass(z.loading),t=e.find("."+v.className.active),i=T?e.find(T):t.next(x.side).size()>0?t.next(x.side):e.find(x.side).first(),n={};t.removeClass(z.active),i.addClass(z.active),e.prependTo(s),n={width:i.outerWidth(),height:i.outerHeight()},e.remove(),S.css(n),p.verbose("Resizing stage to fit new content",n)},nextSide:function(e){T=e,m=S.find(e),0===m.size()&&p.error(y.side),p.verbose("Next side manually set to",m)},active:function(){p.verbose("Setting new side to active",m),k.removeClass(z.active),m.addClass(z.active),e.proxy(v.onChange,m[0])(),p.set.defaultSide()}},flip:{up:function(){p.debug("Flipping up",m),p.is.animating()?p.queue("flip up"):(p.set.stageSize(),p.stage.above(),p.animate(p.get.transform.up()))},down:function(){p.debug("Flipping down",m),p.is.animating()?p.queue("flip down"):(p.set.stageSize(),p.stage.below(),p.animate(p.get.transform.down()))},left:function(){p.debug("Flipping left",m),p.is.animating()?p.queue("flip left"):(p.set.stageSize(),p.stage.left(),p.animate(p.get.transform.left()))},right:function(){p.debug("Flipping right",m),p.is.animating()?p.queue("flip right"):(p.set.stageSize(),p.stage.right(),p.animate(p.get.transform.right()))},over:function(){p.debug("Flipping over",m),p.is.animating()?p.queue("flip over"):(p.set.stageSize(),p.stage.behind(),p.animate(p.get.transform.over()))},back:function(){p.debug("Flipping back",m),p.is.animating()?p.queue("flip back"):(p.set.stageSize(),p.stage.behind(),p.animate(p.get.transform.back()))}},get:{transform:{up:function(){var e={y:-((t.outerHeight()-m.outerHeight())/2),z:-(t.outerHeight()/2)};return{tr
|