2022-02-23 21:46:34 +00:00
|
|
|
!function(T,k,F){"use strict";T.isFunction=T.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},k=void 0!==k&&k.Math==Math?k:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),T.fn.accordion=function(m){var h,v=T(this),b=(new Date).getTime(),y=[],C=m,O="string"==typeof C,x=[].slice.call(arguments,1);return v.each(function(){var n,s=T.isPlainObject(m)?T.extend(!0,{},T.fn.accordion.settings,m):T.extend({},T.fn.accordion.settings),a=s.className,t=s.namespace,l=s.selector,p=s.error,i="."+t,e="module-"+t,o=v.selector||"",c=T(this),r=c.find(l.title),d=c.find(l.content),u=this,g=c.data(e),f={initialize:function(){f.debug("Initializing",c),f.bind.events(),s.observeChanges&&f.observeChanges(),f.instantiate()},instantiate:function(){g=f,c.data(e,f)},destroy:function(){f.debug("Destroying previous instance",c),c.off(i).removeData(e)},refresh:function(){r=c.find(l.title),d=c.find(l.content)},observeChanges:function(){"MutationObserver"in k&&((n=new MutationObserver(function(e){f.debug("DOM tree modified, updating selector cache"),f.refresh()})).observe(u,{childList:!0,subtree:!0}),f.debug("Setting up mutation observer",n))},bind:{events:function(){f.debug("Binding delegated events"),c.on(s.on+i,l.trigger,f.event.click)}},event:{click:function(){f.toggle.call(this)}},toggle:function(e){var e=e!==F?"number"==typeof e?r.eq(e):T(e).closest(l.title):T(this).closest(l.title),n=e.next(d),t=n.hasClass(a.animating),n=n.hasClass(a.active),i=n&&!t,n=!n&&t;f.debug("Toggling visibility of content",e),i||n?s.collapsible?f.close.call(e):f.debug("Cannot close accordion content collapsing is disabled"):f.open.call(e)},open:function(e){var e=e!==F?"number"==typeof e?r.eq(e):T(e).closest(l.title):T(this).closest(l.title),n=e.next(d),t=n.hasClass(a.animating);n.hasClass(a.active)||t?f.debug("Accordion already open, skipping",n):(f.debug("Opening accordion content",e),s.onOpening.call(n),s.onChanging.call(n),s.exclusive&&f.closeOthers.call(e),e.addClass(a.active),n.stop(!0,!0).addClass(a.animating),s.animateChildren&&(T.fn.transition!==F&&c.transition("is supported")?n.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:s.debug,verbose:s.verbose,duration:s.duration,skipInlineHidden:!0,onComplete:function(){n.children().removeClass(a.transition)}}):n.children().stop(!0,!0).animate({opacity:1},s.duration,f.resetOpacity)),n.slideDown(s.duration,s.easing,function(){n.removeClass(a.animating).addClass(a.active),f.reset.display.call(this),s.onOpen.call(this),s.onChange.call(this)}))},close:function(e){var e=e!==F?"number"==typeof e?r.eq(e):T(e).closest(l.title):T(this).closest(l.title),n=e.next(d),t=n.hasClass(a.animating),i=n.hasClass(a.active);!i&&!(!i&&t)||i&&t||(f.debug("Closing accordion content",n),s.onClosing.call(n),s.onChanging.call(n),e.removeClass(a.active),n.stop(!0,!0).addClass(a.animating),s.animateChildren&&(T.fn.transition!==F&&c.transition("is supported")?n.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:s.debug,verbose:s.verbose,duration:s.duration,skipInlineHidden:!0}):n.children().stop(!0,!0).animate({opacity:0},s.duration,f.resetOpacity)),n.slideUp(s.duration,s.easing,function(){n.removeClass(a.animating).removeClass(a.active),f.reset.display.call(this),s.onClose.call(this),s.onChange.call(this)}))},closeOthers:function(e){var n,e=e!==F?r.eq(e):T(this).closest(l.title),t=e.parents(l.content).prev(l.title),e=e.closest(l.accordion),i=l.title+"."+a.active+":visible",o=l.content+"."+a.active+":visible",o=s.closeNested?(n=e.find(i).not(t)).next(d):(n=e.find(i).not(t),e=e.find(o).find(i).not(t),(n=n.not(e)).next(d));0<n.length&&(f.debug("Exclusive enabled, closing other content",n),n.removeClass(a.active),o.removeClass(a.animating).stop(!0,!0),s.animateChildren&&(T.fn.transition!==F&&c.transition("is supported")?o.children().transition({animation:"fade out",useFailSafe:!0,debug:s.debug,verbose:s.verbose,duration:s.duration,skipInlineHidden:!0}):o.children().stop(!0,!0).animate({opacity:0},s.duration,f.resetOpacity)),o.slideUp(s.duration,s.easing,
|