aboutsummaryrefslogtreecommitdiff
path: root/js/dist/scrollspy.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/dist/scrollspy.js')
-rw-r--r--js/dist/scrollspy.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/js/dist/scrollspy.js b/js/dist/scrollspy.js
index ca06e1f55..c1e6d2134 100644
--- a/js/dist/scrollspy.js
+++ b/js/dist/scrollspy.js
@@ -71,7 +71,8 @@
* --------------------------------------------------------------------------
*/
var MAX_UID = 1000000;
- var jQuery = window.jQuery; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
+ var _window = window,
+ jQuery = _window.jQuery; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
var toType = function toType(obj) {
return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
@@ -102,7 +103,7 @@
try {
return document.querySelector(selector) ? selector : null;
- } catch (err) {
+ } catch (error) {
return null;
}
};
@@ -159,18 +160,15 @@
};
var ClassName = {
DROPDOWN_ITEM: 'dropdown-item',
- DROPDOWN_MENU: 'dropdown-menu',
ACTIVE: 'active'
};
var Selector = {
DATA_SPY: '[data-spy="scroll"]',
- ACTIVE: '.active',
NAV_LIST_GROUP: '.nav, .list-group',
NAV_LINKS: '.nav-link',
NAV_ITEMS: '.nav-item',
LIST_ITEMS: '.list-group-item',
DROPDOWN: '.dropdown',
- DROPDOWN_ITEMS: '.dropdown-item',
DROPDOWN_TOGGLE: '.dropdown-toggle'
};
var OffsetMethod = {
@@ -193,7 +191,7 @@
this._element = element;
this._scrollElement = element.tagName === 'BODY' ? window : element;
this._config = this._getConfig(config);
- this._selector = this._config.target + " " + Selector.NAV_LINKS + "," + (this._config.target + " " + Selector.LIST_ITEMS + ",") + (this._config.target + " " + Selector.DROPDOWN_ITEMS);
+ this._selector = this._config.target + " " + Selector.NAV_LINKS + "," + (this._config.target + " " + Selector.LIST_ITEMS + ",") + (this._config.target + " ." + ClassName.DROPDOWN_ITEM);
this._offsets = [];
this._targets = [];
this._activeTarget = null;
@@ -234,7 +232,6 @@
var targetBCR = target.getBoundingClientRect();
if (targetBCR.width || targetBCR.height) {
- // TODO (fat): remove sketch reliance on jQuery position/offset
return [Manipulator[offsetMethod](target).top + offsetBase, targetSelector];
}
}