PageSourceSearch

https://gms.kidneyfund.org/theme/js/sidebarmenu.js?1677619301

js kidneyfund.org collected 2026-10-02 02:54:45 UTC 10,298 bytes, 342 lines download raw bytes

1/*
2Template Name: Monster Admin
3Author: Themedesigner
4Email: [email protected]
5File: js
6*/
7(function (global, factory) {
8  if (typeof define === "function" && define.amd) {
9    define(['jquery'], factory);
10  } else if (typeof exports !== "undefined") {
11    factory(require('jquery'));
12  } else {
13    var mod = {
14      exports: {}
15    };
16    factory(global.jquery);
17    global.metisMenu = mod.exports;
18  }
19})(this, function (_jquery) {
20  'use strict';
21
22  var _jquery2 = _interopRequireDefault(_jquery);
23
24  function _interopRequireDefault(obj) {
25    return obj && obj.__esModule ? obj : {
26      default: obj
27    };
28  }
29
30  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
31    return typeof obj;
32  } : function (obj) {
33    return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
34  };
35
36  function _classCallCheck(instance, Constructor) {
37    if (!(instance instanceof Constructor)) {
38      throw new TypeError("Cannot call a class as a function");
39    }
40  }
41
42  var Util = function ($) {
43    var transition = false;
44
45    var TransitionEndEvent = {
46      WebkitTransition: 'webkitTransitionEnd',
47      MozTransition: 'transitionend',
48      OTransition: 'oTransitionEnd otransitionend',
49      transition: 'transitionend'
50    };
51
52    function getSpecialTransitionEndEvent() {
53      return {
54        bindType: transition.end,
55        delegateType: transition.end,
56        handle: function handle(event) {
57          if ($(event.target).is(this)) {
58            return event.handleObj.handler.apply(this, arguments);
59          }
60          return undefined;
61        }
62      };
63    }
64
65    function transitionEndTest() {
66      if (window.QUnit) {
67        return false;
68      }
69
70      var el = document.createElement('mm');
71
72      for (var name in TransitionEndEvent) {
73        if (el.style[name] !== undefined) {
74          return {
75            end: TransitionEndEvent[name]
76          };
77        }
78      }
79
80      return false;
81    }
82
83    function transitionEndEmulator(duration) {
84      var _this2 = this;
85
86      var called = false;
87
88      $(this).one(Util.TRANSITION_END, function () {
89        called = true;
90      });
91
92      setTimeout(function () {
93        if (!called) {
94          Util.triggerTransitionEnd(_this2);
95        }
96      }, duration);
97
98      return this;
99    }
100
101    function setTransitionEndSupport() {
102      transition = transitionEndTest();
103      $.fn.emulateTransitionEnd = transitionEndEmulator;
104
105      if (Util.supportsTransitionEnd()) {
106        $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
107      }
108    }
109
110    var Util = {
111      TRANSITION_END: 'mmTransitionEnd',
112
113      triggerTransitionEnd: function triggerTransitionEnd(element) {
114        $(element).trigger(transition.end);
115      },
116      supportsTransitionEnd: function supportsTransitionEnd() {
117        return Boolean(transition);
118      }
119    };
120
121    setTransitionEndSupport();
122
123    return Util;
124  }(jQuery);
125
126  var MetisMenu = function ($) {
127
128    var NAME = 'metisMenu';
129    var DATA_KEY = 'metisMenu';
130    var EVENT_KEY = '.' + DATA_KEY;
131    var DATA_API_KEY = '.data-api';
132    var JQUERY_NO_CONFLICT = $.fn[NAME];
133    var TRANSITION_DURATION = 350;
134
135    var Default = {
136      toggle: true,
137      preventDefault: true,
138      activeClass: 'active',
139      collapseClass: 'collapse',
140      collapseInClass: 'in',
141      collapsingClass: 'collapsing',
142      triggerElement: 'a',
143      parentTrigger: 'li',
144      subMenu: 'ul'
145    };
146
147    var Event = {
148      SHOW: 'show' + EVENT_KEY,
149      SHOWN: 'shown' + EVENT_KEY,
150      HIDE: 'hide' + EVENT_KEY,
151      HIDDEN: 'hidden' + EVENT_KEY,
152      CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY
153    };
154
155    var MetisMenu = function () {
156      function MetisMenu(element, config) {
157        _classCallCheck(this, MetisMenu);
158
159        this._element = element;
160        this._config = this._getConfig(config);
161        this._transitioning = null;
162
163        this.init();
164      }
165
166      MetisMenu.prototype.init = function init() {
167        var self = this;
168        $(this._element).find(this._config.parentTrigger + '.' + this._config.activeClass).has(this._config.subMenu).
168children(this._config.subMenu).attr('aria-expanded', true).addClass(this._config.collapseClass + ' ' + this._config.collapseInClass);
169
170        $(this._element).find(this._config.parentTrigger).not('.' + this._config.activeClass).has(this._config.subMenu).children(this._config.subMenu).attr('aria-expanded', false).addClass(this._config.collapseClass);
171
172        $(this._element).find(this._config.parentTrigger).has(this._config.subMenu).children(this._config.triggerElement).on(Event.CLICK_DATA_API, function (e) {
173          var _this = $(this);
174          var _parent = _this.parent(self._config.parentTrigger);
175          var _siblings = _parent.siblings(self._config.parentTrigger).children(self._config.triggerElement);
176          var _list = _parent.children(self._config.subMenu);
177          if (self._config.preventDefault) {
178            e.preventDefault();
179          }
180          if (_this.attr('aria-disabled') === 'true') {
181            return;
182          }
183          if (_parent.hasClass(self._config.activeClass)) {
184            _this.attr('aria-expanded', false);
185            self._hide(_list);
186          } else {
187            self._show(_list);
188            _this.attr('aria-expanded', true);
189            if (self._config.toggle) {
190              _siblings.attr('aria-expanded', false);
191            }
192          }
193
194          if (self._config.onTransitionStart) {
195            self._config.onTransitionStart(e);
196          }
197        });
198      };
199
200      MetisMenu.prototype._show = function _show(element) {
201        if (this._transitioning || $(element).hasClass(this._config.collapsingClass)) {
202          return;
203        }
204        var _this = this;
205        var _el = $(element);
206
207        var startEvent = $.Event(Event.SHOW);
208        _el.trigger(startEvent);
209
210        if (startEvent.isDefaultPrevented()) {
211          return;
212        }
213
214        _el.parent(this._config.parentTrigger).addClass(this._config.activeClass);
215
216        if (this._config.toggle) {
217          this._hide(_el.parent(this._config.parentTrigger).siblings().children(this._config.subMenu + '.' + this._config.collapseInClass).attr('aria-expanded', false));
218        }
219
220        _el.removeClass(this._config.collapseClass).addClass(this._config.collapsingClass).height(0);
221
222        this.setTransitioning(true);
223
224        var complete = function complete() {
225
226          _el.removeClass(_this._config.collapsingClass).addClass(_this._config.collapseClass + ' ' + _this._config.collapseInClass).height('').attr('aria-expanded', true);
227
228          _this.setTransitioning(false);
229
230          _el.trigger(Event.SHOWN);
231        };
232
233        if (!Util.supportsTransitionEnd()) {
234          complete();
235          return;
236        }
237
238        _el.height(_el[0].scrollHeight).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
239      };
240
241      MetisMenu.prototype._hide = function _hide(element) {
242
243        if (this._transitioning || !$(element).hasClass(this._config.collapseInClass)) {
244          return;
245        }
246        var _this = this;
247        var _el = $(element);
248
249        var startEvent = $.Event(Event.HIDE);
250        _el.trigger(startEvent);
251
252        if (startEvent.isDefaultPrevented()) {
253          return;
254        }
255
256        _el.parent(this._config.parentTrigger).removeClass(this._config.activeClass);
257        _el.height(_el.height())[0].offsetHeight;
258
259        _el.addClass(this._config.collapsingClass).removeClass(this._config.collapseClass).removeClass(this._config.collapseInClass);
260
261        this.setTransitioning(true);
262
263        var complete = function complete() {
264          if (_this._transitioning && _this._config.onTransitionEnd) {
265            _this._config.onTransitionEnd();
266          }
267
268          _this.setTransitioning(false);
269          _el.trigger(Event.HIDDEN);
270
271          _el.removeClass(_this._config.collapsingClass).addClass(_this._config.collapseClass).attr('aria-expanded', false);
272        };
273
274        if (!Util.supportsTransitionEnd()) {
275          complete();
276          return;
277        }
278
279        _el.height() == 0 || _el.css('display') == 'none' ? complete() : _el.height(0).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
280      };
281
282      MetisMenu.prototype.setTransitioning = function setTransitioning(isTransitioning) {
283        this._transitioning = isTransitioning;
284      };
285
286      MetisMenu.prototype.dispose = function dispose() {
287        $.removeData(this._element, DATA_KEY);
288
289        $(this._element).find(this._config.parentTrigger).has(this._config.subMenu).
289children(this._config.triggerElement).off('click');
290
291        this._transitioning = null;
292        this._config = null;
293        this._element = null;
294      };
295
296      MetisMenu.prototype._getConfig = function _getConfig(config) {
297        config = $.extend({}, Default, config);
298        return config;
299      };
300
301      MetisMenu._jQueryInterface = function _jQueryInterface(config) {
302        return this.each(function () {
303          var $this = $(this);
304          var data = $this.data(DATA_KEY);
305          var _config = $.extend({}, Default, $this.data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config);
306
307          if (!data && /dispose/.test(config)) {
308            this.dispose();
309          }
310
311          if (!data) {
312            data = new MetisMenu(this, _config);
313            $this.data(DATA_KEY, data);
314          }
315
316          if (typeof config === 'string') {
317            if (data[config] === undefined) {
318              throw new Error('No method named "' + config + '"');
319            }
320            data[config]();
321          }
322        });
323      };
324
325      return MetisMenu;
326    }();
327
328    /**
329     * ------------------------------------------------------------------------
330     * jQuery
331     * ------------------------------------------------------------------------
332     */
333
334    $.fn[NAME] = MetisMenu._jQueryInterface;
335    $.fn[NAME].Constructor = MetisMenu;
336    $.fn[NAME].noConflict = function () {
337      $.fn[NAME] = JQUERY_NO_CONFLICT;
338      return MetisMenu._jQueryInterface;
339    };
340    return MetisMenu;
341  }(jQuery);
342});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.