Files
PyRIGS/RIGS/static/js/collapse.js

6 lines
6.4 KiB
JavaScript

/*!
* Bootstrap collapse.js v4.4.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","./util.js"],t):(e=e||self).Collapse=t(e.jQuery,e.Util)}(this,(function(e,t){"use strict";function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}e=e&&e.hasOwnProperty("default")?e.default:e,t=t&&t.hasOwnProperty("default")?t.default:t;var s="collapse",a="bs.collapse",o=e.fn[s],c={toggle:!0,parent:""},g={toggle:"boolean",parent:"(string|element)"},u={SHOW:"show.bs.collapse",SHOWN:"shown.bs.collapse",HIDE:"hide.bs.collapse",HIDDEN:"hidden.bs.collapse",CLICK_DATA_API:"click.bs.collapse.data-api"},h="show",f="collapse",d="collapsing",_="collapsed",p="width",m="height",y=".show, .collapsing",v='[data-toggle="collapse"]',C=function(){function r(e,n){this._isTransitioning=!1,this._element=e,this._config=this._getConfig(n),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var r=[].slice.call(document.querySelectorAll(v)),i=0,l=r.length;i<l;i++){var s=r[i],a=t.getSelectorFromElement(s),o=[].slice.call(document.querySelectorAll(a)).filter((function(t){return t===e}));null!==a&&o.length>0&&(this._selector=a,this._triggerArray.push(s))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var i,o,C,b=r.prototype;return b.toggle=function(){e(this._element).hasClass(h)?this.hide():this.show()},b.show=function(){var n,i,l=this;if(!this._isTransitioning&&!e(this._element).hasClass(h)&&(this._parent&&0===(n=[].slice.call(this._parent.querySelectorAll(y)).filter((function(e){return"string"==typeof l._config.parent?e.getAttribute("data-parent")===l._config.parent:e.classList.contains(f)}))).length&&(n=null),!(n&&(i=e(n).not(this._selector).data(a))&&i._isTransitioning))){var s=e.Event(u.SHOW);if(e(this._element).trigger(s),!s.isDefaultPrevented()){n&&(r._jQueryInterface.call(e(n).not(this._selector),"hide"),i||e(n).data(a,null));var o=this._getDimension();e(this._element).removeClass(f).addClass(d),this._element.style[o]=0,this._triggerArray.length&&e(this._triggerArray).removeClass(_).attr("aria-expanded",!0),this.setTransitioning(!0);var c="scroll"+(o[0].toUpperCase()+o.slice(1)),g=t.getTransitionDurationFromElement(this._element);e(this._element).one(t.TRANSITION_END,(function(){e(l._element).removeClass(d).addClass(f).addClass(h),l._element.style[o]="",l.setTransitioning(!1),e(l._element).trigger(u.SHOWN)})).emulateTransitionEnd(g),this._element.style[o]=this._element[c]+"px"}}},b.hide=function(){var n=this;if(!this._isTransitioning&&e(this._element).hasClass(h)){var r=e.Event(u.HIDE);if(e(this._element).trigger(r),!r.isDefaultPrevented()){var i=this._getDimension();this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",t.reflow(this._element),e(this._element).addClass(d).removeClass(f).removeClass(h);var l=this._triggerArray.length;if(l>0)for(var s=0;s<l;s++){var a=this._triggerArray[s],o=t.getSelectorFromElement(a);if(null!==o)e([].slice.call(document.querySelectorAll(o))).hasClass(h)||e(a).addClass(_).attr("aria-expanded",!1)}this.setTransitioning(!0);this._element.style[i]="";var c=t.getTransitionDurationFromElement(this._element);e(this._element).one(t.TRANSITION_END,(function(){n.setTransitioning(!1),e(n._element).removeClass(d).addClass(f).trigger(u.HIDDEN)})).emulateTransitionEnd(c)}}},b.setTransitioning=function(e){this._isTransitioning=e},b.dispose=function(){e.removeData(this._element,a),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},b._getConfig=function(e){return(e=l({},c,{},e)).toggle=Boolean(e.toggle),t.typeCheckConfig(s,e,g),e},b._getDimension=function(){return e(this._element).hasClass(p)?p:m},b._getParent=function(){var n,i=this;t.isElement(this._config.parent)?(n=this._config.parent,void 0!==this._config.parent.jquery&&(n=this._config.parent[0])):n=document.querySelector(this._config.parent);var l='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',s=[].slice.call(n.querySelectorAll(l));return e(s).each((function(e,t){i._addAriaAndCollapsedClass(r._getTargetFromElement(t),[t])})),n},b._addAriaAndCollapsedClass=function(t,n){var r=e(t).hasClass(h);n.length&&e(n).toggleClass(_,!r).attr("aria-expanded",r)},r._getTargetFromElement=function(e){var n=t.getSelectorFromElement(e);return n?document.querySelector(n):null},r._jQueryInterface=function(t){return this.each((function(){var n=e(this),i=n.data(a),s=l({},c,{},n.data(),{},"object"==typeof t&&t?t:{});if(!i&&s.toggle&&/show|hide/.test(t)&&(s.toggle=!1),i||(i=new r(this,s),n.data(a,i)),"string"==typeof t){if(void 0===i[t])throw new TypeError('No method named "'+t+'"');i[t]()}}))},i=r,C=[{key:"VERSION",get:function(){return"4.4.1"}},{key:"Default",get:function(){return c}}],(o=null)&&n(i.prototype,o),C&&n(i,C),r}();return e(document).on(u.CLICK_DATA_API,v,(function(n){"A"===n.currentTarget.tagName&&n.preventDefault();var r=e(this),i=t.getSelectorFromElement(this),l=[].slice.call(document.querySelectorAll(i));e(l).each((function(){var t=e(this),n=t.data(a)?"toggle":r.data();C._jQueryInterface.call(t,n)}))})),e.fn[s]=C._jQueryInterface,e.fn[s].Constructor=C,e.fn[s].noConflict=function(){return e.fn[s]=o,C._jQueryInterface},C}));