|
|
!function(a,b,c,d){a.fn.accordion=function(c){{var e,f=a(this),g=(new Date).getTime(),h=[],i=arguments[0],j="string"==typeof i,k=[].slice.call(arguments,1);b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)}}return f.each(function(){var b,l=a.isPlainObject(c)?a.extend(!0,{},a.fn.accordion.settings,c):a.extend({},a.fn.accordion.settings),m=l.className,n=l.namespace,o=l.selector,p=(l.error,"."+n),q="module-"+n,r=f.selector||"",s=a(this),t=s.find(o.title),u=s.find(o.content),v=this,w=s.data(q);b={initialize:function(){b.debug("Initializing accordion with bound events",s),t.on("click"+p,b.event.click),b.instantiate()},instantiate:function(){w=b,s.data(q,b)},destroy:function(){b.debug("Destroying previous accordion for",s),s.removeData(q),t.off(p)},reset:{display:function(){b.verbose("Removing inline display from element",this),a(this).css("display",""),""===a(this).attr("style")&&a(this).attr("style","").removeAttr("style")},opacity:function(){b.verbose("Removing inline opacity from element",this),a(this).css("opacity",""),""===a(this).attr("style")&&a(this).attr("style","").removeAttr("style")}},event:{click:function(){a.proxy(b.toggle,this)()}},toggle:function(c){var d=c?t.eq(c):a(this),e=d.next(u),f=e.is(":visible");b.debug("Toggling visibility of content",d),f?l.collapsible?a.proxy(b.close,d)():b.debug("Cannot close accordion content collapsing is disabled"):a.proxy(b.open,d)()},open:function(c){var d=c?t.eq(c):a(this),e=d.next(u),f=e.is(":animated");f||(b.debug("Opening accordion content",d),l.exclusive&&a.proxy(b.closeOthers,d)(),d.addClass(m.active),e.stop().children().stop().animate({opacity:1},l.duration,b.reset.display).end().slideDown(l.duration,l.easing,function(){e.addClass(m.active),a.proxy(b.reset.display,this)(),a.proxy(l.onOpen,e)(),a.proxy(l.onChange,e)()}))},close:function(c){var d=c?t.eq(c):a(this),e=d.next(u);b.debug("Closing accordion content",e),d.removeClass(m.active),e.removeClass(m.active).show().stop().children().stop().animate({opacity:0},l.duration,b.reset.opacity).end().slideUp(l.duration,l.easing,function(){a.proxy(b.reset.display,this)(),a.proxy(l.onClose,e)(),a.proxy(l.onChange,e)()})},closeOthers:function(c){var d=c?t.eq(c):a(this),e=d.parents(o.content).prev(o.title),f=d.closest(o.accordion),g=f.find(o.title+"."+m.active+":visible").not(e),h=g.next(u),i=g.size()>0;i&&(b.debug("Exclusive enabled, closing other content",g),g.removeClass(m.active),h.stop().children().stop().animate({opacity:0},l.duration,b.resetOpacity).end().slideUp(l.duration,l.easing,function(){a(this).removeClass(m.active),a.proxy(b.reset.display,this)()}))},setting:function(c,e){if(b.debug("Changing setting",c,e),a.isPlainObject(c))a.extend(!0,l,c);else{if(e===d)return l[c];l[c]=e}},internal:function(c,e){return b.debug("Changing internal",c,e),e===d?b[c]:void(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e)},debug:function(){l.debug&&(l.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,l.name+":"),b.debug.apply(console,arguments)))},verbose:function(){l.verbose&&l.debug&&(l.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,l.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;l.performance&&(c=(new Date).getTime(),e=g||c,d=c-e,g=c,h.push({Element:v,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=l.name+":",e=0;g=!1,clearTimeout(b.performance.timer),a.each(h,function(a,b){e+=b["Execution Time"]}),c+=" "+e+"ms",r&&(c+=" '"+r+"'"),(console.group!==d||console.table!==d)&&h.length>0&&(console.groupCollapsed(c),console.table?console.table(h):a.each(h,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),h=[]}},invoke:function(
|