mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-08 22:56:46 +02:00
Dist.
This commit is contained in:
11
js/dist/scrollspy.js
vendored
11
js/dist/scrollspy.js
vendored
@@ -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];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user