PageSourceSearch

https://mason360.gmu.edu/static/js/bootstrap.cg.js

js gmu.edu collected 2026-09-24 07:03:18 UTC 1,827 bytes, 62 lines download raw bytes

1/* ========================================================================
2 * CampusGroups Bootstrap Extensions
3 * Extends Bootstrap 3.3.7 dropdown with explicit open() and close() methods
4 * Requires: bootstrap.js (loaded first)
5 * ======================================================================== */
6
7+function ($) {
8  'use strict';
9
10  var Dropdown = $.fn.dropdown.Constructor;
11  var backdrop = '.dropdown-backdrop';
12
13  Dropdown.prototype.open = function () {
14    var $this = $(this);
15
16    if ($this.is('.disabled, :disabled')) return;
17
18    var $parent = $this.parent();
19    if ($parent.hasClass('open')) return;
20
21    var relatedTarget = { relatedTarget: this };
22    var e = $.Event('show.bs.dropdown', relatedTarget);
23    $parent.trigger(e);
24
25    if (e.isDefaultPrevented()) return;
26
27    if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
28      $(document.createElement('div'))
29        .addClass('dropdown-backdrop')
30        .insertAfter($this)
31        .on('click', function () { $this.dropdown('close'); });
32    }
33
34    $this
35      .trigger('focus')
36      .attr('aria-expanded', 'true');
37
38    $parent
39      .addClass('open')
40      .trigger($.Event('shown.bs.dropdown', relatedTarget));
41  };
42
43  Dropdown.prototype.close = function () {
44    $(backdrop).remove();
45    $('[data-toggle="dropdown"]').each(function () {
46      var $this         = $(this);
47      var $parent       = $this.parent();
48      var relatedTarget = { relatedTarget: this };
49
50      if (!$parent.hasClass('open')) return;
51
52      $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget));
53
54      var e;
55      if (e.isDefaultPrevented()) return;
56
57      $this.attr('aria-expanded', 'false');
58      $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget));
59    });
60  };
61
62}(jQuery);

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.