11 lines
9.8 KiB
JavaScript
11 lines
9.8 KiB
JavaScript
|
/*
|
||
|
* # Fomantic UI - 2.8.8
|
||
|
* https://github.com/fomantic/Fomantic-UI
|
||
|
* http://fomantic-ui.com/
|
||
|
*
|
||
|
* Copyright 2021 Contributors
|
||
|
* Released under the MIT license
|
||
|
* http://opensource.org/licenses/MIT
|
||
|
*
|
||
|
*/
|
||
|
!function(E,e,Y,F){"use strict";E.isFunction=E.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e=void 0!==e&&e.Math==Math?e:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),E.fn.shape=function(b){var x,y=E(this),w=(new Date).getTime(),C=[],S=b,T="string"==typeof S,W=[].slice.call(arguments,1),A=e.requestAnimationFrame||e.mozRequestAnimationFrame||e.webkitRequestAnimationFrame||e.msRequestAnimationFrame||function(e){setTimeout(e,0)};return y.each(function(){var n,o,r,t=y.selector||"",s=E.isPlainObject(b)?E.extend(!0,{},E.fn.shape.settings,b):E.extend({},E.fn.shape.settings),e=s.namespace,d=s.selector,i=s.error,l=s.className,a="."+e,u="module-"+e,c=E(this),f=c.find(">"+d.sides),g=f.find(">"+d.side),h=!1,m=this,p=c.data(u);if(r={initialize:function(){r.verbose("Initializing module for",m),r.set.defaultSide(),r.instantiate()},instantiate:function(){r.verbose("Storing instance of module",r),p=r,c.data(u,p)},destroy:function(){r.verbose("Destroying previous module for",m),c.removeData(u).off(a)},refresh:function(){r.verbose("Refreshing selector cache for",m),c=E(m),f=E(this).find(d.sides),g=E(this).find(d.side)},repaint:function(){r.verbose("Forcing repaint event");(f[0]||Y.createElement("div")).offsetWidth},animate:function(e,t){r.verbose("Animating box with properties",e),t=t||function(e){r.verbose("Executing animation callback"),e!==F&&e.stopPropagation(),r.reset(),r.set.active()},s.beforeChange.call(o[0]),r.get.transitionEvent()?(r.verbose("Starting CSS animation"),c.addClass(l.animating),f.css(e).one(r.get.transitionEvent(),t),r.set.duration(s.duration),A(function(){c.addClass(l.animating),n.addClass(l.hidden)})):t()},queue:function(e){r.debug("Queueing animation of",e),f.one(r.get.transitionEvent(),function(){r.debug("Executing queued animation"),setTimeout(function(){c.shape(e)},0)})},reset:function(){r.verbose("Animating states reset"),c.removeClass(l.animating).attr("style","").removeAttr("style"),f.attr("style","").removeAttr("style"),g.attr("style","").removeAttr("style").removeClass(l.hidden),o.removeClass(l.animating).attr("style","").removeAttr("style")},is:{complete:function(){return g.filter("."+l.active)[0]==o[0]},animating:function(){return c.hasClass(l.animating)},hidden:function(){return 0<c.closest(":hidden").length}},set:{defaultSide:function(){n=g.filter("."+s.className.active),o=0<n.next(d.side).length?n.next(d.side):g.first(),h=!1,r.verbose("Active side set to",n),r.verbose("Next side set to",o)},duration:function(e){e="number"==typeof(e=e||s.duration)?e+"ms":e,r.verbose("Setting animation duration",e),!s.duration&&0!==s.duration||f.add(g).css({"-webkit-transition-duration":e,"-moz-transition-duration":e,"-ms-transition-duration":e,"-o-transition-duration":e,"transition-duration":e})},currentStageSize:function(){var e=g.filter("."+s.className.active),t=e.outerWidth(!0),i=e.outerHeight(!0);c.css({width:t,height:i})},stageSize:function(){var e=c.clone().addClass(l.loading),t=e.find(">"+d.sides+">"+d.side),i=t.filter("."+s.className.active),n=h?t.eq(h):0<i.next(d.side).length?i.next(d.side):t.first(),o="next"===s.width?n.outerWidth(!0):"initial"===s.width?c.width():s.width,a="next"===s.height?n.outerHeight(!0):"initial"===s.height?c.height():s.height;i.removeClass(l.active),n.addClass(l.active),e.insertAfter(c),e.remove(),"auto"!==s.width&&(c.css("width",o+s.jitter),r.verbose("Specifying width during animation",o)),"auto"!==s.height&&(c.css("height",a+s.jitter),r.verbose("Specifying height during animation",a))},nextSide:function(e){h=e,o=g.filter(e),h=g.index(o),0===o.length&&(r.set.defaultSide(),r.error(i.side)),r.verbose("Next side manually set to",o)},active:function(){r.verbose("Setting new side to active",o),g.removeClass(l.active),o.addClass(l.active),s.onChange.call(o[0]),r.set.defaultSide()}},flip:{to:function(e,t){if(r.is.hidden())r.debug("Module not visible",o);else if(!r.is.complete()||r.is.animating()||s.allowRepeats){var i=r.get.transform[e]();r.is.animating()?r.queue("flip "+e):(r.debug("Flipping "+e,o),r.set.stageSize(),r.stage[t]()
|