2018-11-13 01:41:12 -05:00
/ * !
2021-03-23 12:26:54 -04:00
* Bootstrap scrollspy . js v5 . 0.0 - beta3 ( https : //getbootstrap.com/)
2021-02-10 11:14:51 -05:00
* Copyright 2011 - 2021 The Bootstrap Authors ( https : //github.com/twbs/bootstrap/graphs/contributors)
2020-06-16 14:50:01 -04:00
* Licensed under MIT ( https : //github.com/twbs/bootstrap/blob/main/LICENSE)
2018-11-13 01:41:12 -05:00
* /
2018-07-23 20:51:14 -04:00
( function ( global , factory ) {
2021-02-10 11:14:51 -05:00
typeof exports === 'object' && typeof module !== 'undefined' ? module . exports = factory ( require ( './dom/data.js' ) , require ( './dom/event-handler.js' ) , require ( './dom/manipulator.js' ) , require ( './dom/selector-engine.js' ) , require ( './base-component.js' ) ) :
typeof define === 'function' && define . amd ? define ( [ './dom/data' , './dom/event-handler' , './dom/manipulator' , './dom/selector-engine' , './base-component' ] , factory ) :
( global = typeof globalThis !== 'undefined' ? globalThis : global || self , global . ScrollSpy = factory ( global . Data , global . EventHandler , global . Manipulator , global . SelectorEngine , global . Base ) ) ;
} ( this , ( function ( Data , EventHandler , Manipulator , SelectorEngine , BaseComponent ) { 'use strict' ;
2018-07-23 20:51:14 -04:00
2020-09-14 11:12:06 -04:00
function _interopDefaultLegacy ( e ) { return e && typeof e === 'object' && 'default' in e ? e : { 'default' : e } ; }
var Data _ _default = /*#__PURE__*/ _interopDefaultLegacy ( Data ) ;
var EventHandler _ _default = /*#__PURE__*/ _interopDefaultLegacy ( EventHandler ) ;
var Manipulator _ _default = /*#__PURE__*/ _interopDefaultLegacy ( Manipulator ) ;
var SelectorEngine _ _default = /*#__PURE__*/ _interopDefaultLegacy ( SelectorEngine ) ;
2021-02-10 11:14:51 -05:00
var BaseComponent _ _default = /*#__PURE__*/ _interopDefaultLegacy ( BaseComponent ) ;
2019-03-01 11:31:34 -05:00
/ * *
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
2021-03-23 12:26:54 -04:00
* Bootstrap ( v5 . 0.0 - beta3 ) : util / index . js
2020-06-16 14:50:01 -04:00
* Licensed under MIT ( https : //github.com/twbs/bootstrap/blob/main/LICENSE)
2019-03-01 11:31:34 -05:00
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
* /
2021-03-23 12:26:54 -04:00
const MAX _UID = 1000000 ;
2019-03-01 11:31:34 -05:00
2021-03-23 12:26:54 -04:00
const toType = obj => {
2020-03-28 06:29:08 -04:00
if ( obj === null || obj === undefined ) {
2021-03-23 12:26:54 -04:00
return ` ${ obj } ` ;
2020-03-28 06:29:08 -04:00
}
2019-03-01 11:31:34 -05:00
return { } . toString . call ( obj ) . match ( /\s([a-z]+)/i ) [ 1 ] . toLowerCase ( ) ;
} ;
/ * *
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
* Public Util Api
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
* /
2021-03-23 12:26:54 -04:00
const getUID = prefix => {
2019-03-01 11:31:34 -05:00
do {
2020-06-13 18:40:28 -04:00
prefix += Math . floor ( Math . random ( ) * MAX _UID ) ;
2019-03-01 11:31:34 -05:00
} while ( document . getElementById ( prefix ) ) ;
return prefix ;
} ;
2021-03-23 12:26:54 -04:00
const getSelector = element => {
let selector = element . getAttribute ( 'data-bs-target' ) ;
2019-03-01 11:31:34 -05:00
if ( ! selector || selector === '#' ) {
2021-03-23 12:26:54 -04:00
let hrefAttr = element . getAttribute ( 'href' ) ; // The only valid content that could double as a selector are IDs or classes,
2021-02-10 11:14:51 -05:00
// so everything starting with `#` or `.`. If a "real" URL is used as the selector,
// `document.querySelector` will rightfully complain it is invalid.
// See https://github.com/twbs/bootstrap/issues/32273
if ( ! hrefAttr || ! hrefAttr . includes ( '#' ) && ! hrefAttr . startsWith ( '.' ) ) {
return null ;
} // Just in case some CMS puts out a full URL with the anchor appended
if ( hrefAttr . includes ( '#' ) && ! hrefAttr . startsWith ( '#' ) ) {
hrefAttr = '#' + hrefAttr . split ( '#' ) [ 1 ] ;
}
2019-08-27 09:03:21 -04:00
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr . trim ( ) : null ;
2019-03-01 11:31:34 -05:00
}
2019-08-27 09:03:21 -04:00
return selector ;
} ;
2021-03-23 12:26:54 -04:00
const getSelectorFromElement = element => {
const selector = getSelector ( element ) ;
2019-08-27 09:03:21 -04:00
if ( selector ) {
2019-03-01 11:31:34 -05:00
return document . querySelector ( selector ) ? selector : null ;
}
2019-08-27 09:03:21 -04:00
return null ;
2019-03-01 11:31:34 -05:00
} ;
2021-03-23 12:26:54 -04:00
const isElement = obj => ( obj [ 0 ] || obj ) . nodeType ;
2019-03-01 11:31:34 -05:00
2021-03-23 12:26:54 -04:00
const typeCheckConfig = ( componentName , config , configTypes ) => {
Object . keys ( configTypes ) . forEach ( property => {
const expectedTypes = configTypes [ property ] ;
const value = config [ property ] ;
const valueType = value && isElement ( value ) ? 'element' : toType ( value ) ;
2019-03-01 11:31:34 -05:00
if ( ! new RegExp ( expectedTypes ) . test ( valueType ) ) {
2021-03-23 12:26:54 -04:00
throw new TypeError ( ` ${ componentName . toUpperCase ( ) } : ` + ` Option " ${ property } " provided type " ${ valueType } " ` + ` but expected type " ${ expectedTypes } ". ` ) ;
2019-03-01 11:31:34 -05:00
}
} ) ;
} ;
2021-03-23 12:26:54 -04:00
const getjQuery = ( ) => {
const {
jQuery
} = window ;
2019-08-27 09:03:21 -04:00
2020-11-23 08:17:16 -05:00
if ( jQuery && ! document . body . hasAttribute ( 'data-bs-no-jquery' ) ) {
2019-08-27 09:03:21 -04:00
return jQuery ;
}
return null ;
} ;
2021-03-23 12:26:54 -04:00
const onDOMContentLoaded = callback => {
2020-11-11 12:07:37 -05:00
if ( document . readyState === 'loading' ) {
document . addEventListener ( 'DOMContentLoaded' , callback ) ;
} else {
callback ( ) ;
}
} ;
2021-03-23 12:26:54 -04:00
const defineJQueryPlugin = ( name , plugin ) => {
onDOMContentLoaded ( ( ) => {
const $ = getjQuery ( ) ;
2021-02-10 11:14:51 -05:00
/* istanbul ignore if */
2020-12-03 09:18:59 -05:00
2021-02-10 11:14:51 -05:00
if ( $ ) {
2021-03-23 12:26:54 -04:00
const JQUERY _NO _CONFLICT = $ . fn [ name ] ;
2021-02-10 11:14:51 -05:00
$ . fn [ name ] = plugin . jQueryInterface ;
$ . fn [ name ] . Constructor = plugin ;
2020-12-03 09:18:59 -05:00
2021-03-23 12:26:54 -04:00
$ . fn [ name ] . noConflict = ( ) => {
2021-02-10 11:14:51 -05:00
$ . fn [ name ] = JQUERY _NO _CONFLICT ;
return plugin . jQueryInterface ;
} ;
2020-12-03 09:18:59 -05:00
}
2021-02-10 11:14:51 -05:00
} ) ;
} ;
2020-12-03 09:18:59 -05:00
2021-03-23 12:26:54 -04:00
/ * *
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
* Bootstrap ( v5 . 0.0 - beta3 ) : scrollspy . js
* Licensed under MIT ( https : //github.com/twbs/bootstrap/blob/main/LICENSE)
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
* /
2020-12-03 09:18:59 -05:00
/ * *
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
* Constants
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
* /
2021-03-23 12:26:54 -04:00
const NAME = 'scrollspy' ;
const DATA _KEY = 'bs.scrollspy' ;
const EVENT _KEY = ` . ${ DATA _KEY } ` ;
const DATA _API _KEY = '.data-api' ;
const Default = {
2018-11-13 01:41:12 -05:00
offset : 10 ,
method : 'auto' ,
target : ''
} ;
2021-03-23 12:26:54 -04:00
const DefaultType = {
2018-11-13 01:41:12 -05:00
offset : 'number' ,
method : 'string' ,
target : '(string|element)'
} ;
2021-03-23 12:26:54 -04:00
const EVENT _ACTIVATE = ` activate ${ EVENT _KEY } ` ;
const EVENT _SCROLL = ` scroll ${ EVENT _KEY } ` ;
const EVENT _LOAD _DATA _API = ` load ${ EVENT _KEY } ${ DATA _API _KEY } ` ;
const CLASS _NAME _DROPDOWN _ITEM = 'dropdown-item' ;
const CLASS _NAME _ACTIVE = 'active' ;
const SELECTOR _DATA _SPY = '[data-bs-spy="scroll"]' ;
const SELECTOR _NAV _LIST _GROUP = '.nav, .list-group' ;
const SELECTOR _NAV _LINKS = '.nav-link' ;
const SELECTOR _NAV _ITEMS = '.nav-item' ;
const SELECTOR _LIST _ITEMS = '.list-group-item' ;
const SELECTOR _DROPDOWN = '.dropdown' ;
const SELECTOR _DROPDOWN _TOGGLE = '.dropdown-toggle' ;
const METHOD _OFFSET = 'offset' ;
const METHOD _POSITION = 'position' ;
2019-10-08 02:39:10 -04:00
/ * *
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
* Class Definition
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
* /
2018-11-13 01:41:12 -05:00
2021-03-23 12:26:54 -04:00
class ScrollSpy extends BaseComponent _ _default [ 'default' ] {
constructor ( element , config ) {
super ( element ) ;
this . _scrollElement = this . _element . tagName === 'BODY' ? window : this . _element ;
this . _config = this . _getConfig ( config ) ;
this . _selector = ` ${ this . _config . target } ${ SELECTOR _NAV _LINKS } , ${ this . _config . target } ${ SELECTOR _LIST _ITEMS } , ${ this . _config . target } . ${ CLASS _NAME _DROPDOWN _ITEM } ` ;
this . _offsets = [ ] ;
this . _targets = [ ] ;
this . _activeTarget = null ;
this . _scrollHeight = 0 ;
EventHandler _ _default [ 'default' ] . on ( this . _scrollElement , EVENT _SCROLL , ( ) => this . _process ( ) ) ;
this . refresh ( ) ;
2019-03-01 11:31:34 -05:00
2021-03-23 12:26:54 -04:00
this . _process ( ) ;
2018-11-13 01:41:12 -05:00
} // Getters
2015-05-11 15:05:35 -04:00
2021-03-23 12:26:54 -04:00
static get Default ( ) {
return Default ;
}
static get DATA _KEY ( ) {
return DATA _KEY ;
} // Public
2015-05-11 15:05:35 -04:00
2017-09-30 17:28:03 -04:00
2021-03-23 12:26:54 -04:00
refresh ( ) {
const autoMethod = this . _scrollElement === this . _scrollElement . window ? METHOD _OFFSET : METHOD _POSITION ;
const offsetMethod = this . _config . method === 'auto' ? autoMethod : this . _config . method ;
const offsetBase = offsetMethod === METHOD _POSITION ? this . _getScrollTop ( ) : 0 ;
2018-11-13 01:41:12 -05:00
this . _offsets = [ ] ;
this . _targets = [ ] ;
this . _scrollHeight = this . _getScrollHeight ( ) ;
2021-03-23 12:26:54 -04:00
const targets = SelectorEngine _ _default [ 'default' ] . find ( this . _selector ) ;
targets . map ( element => {
const targetSelector = getSelectorFromElement ( element ) ;
const target = targetSelector ? SelectorEngine _ _default [ 'default' ] . findOne ( targetSelector ) : null ;
2015-05-13 15:55:11 -04:00
2018-11-13 01:41:12 -05:00
if ( target ) {
2021-03-23 12:26:54 -04:00
const targetBCR = target . getBoundingClientRect ( ) ;
2015-05-11 15:05:35 -04:00
2018-11-13 01:41:12 -05:00
if ( targetBCR . width || targetBCR . height ) {
2020-09-14 11:12:06 -04:00
return [ Manipulator _ _default [ 'default' ] [ offsetMethod ] ( target ) . top + offsetBase , targetSelector ] ;
2017-09-30 17:28:03 -04:00
}
2018-11-13 01:41:12 -05:00
}
2015-05-11 15:05:35 -04:00
2018-11-13 01:41:12 -05:00
return null ;
2021-03-23 12:26:54 -04:00
} ) . filter ( item => item ) . sort ( ( a , b ) => a [ 0 ] - b [ 0 ] ) . forEach ( item => {
this . _offsets . push ( item [ 0 ] ) ;
2016-10-09 20:26:51 -04:00
2021-03-23 12:26:54 -04:00
this . _targets . push ( item [ 1 ] ) ;
} ) ;
}
2020-12-03 09:18:59 -05:00
2021-03-23 12:26:54 -04:00
dispose ( ) {
super . dispose ( ) ;
2020-09-14 11:12:06 -04:00
EventHandler _ _default [ 'default' ] . off ( this . _scrollElement , EVENT _KEY ) ;
2018-11-13 01:41:12 -05:00
this . _scrollElement = null ;
this . _config = null ;
this . _selector = null ;
this . _offsets = null ;
this . _targets = null ;
this . _activeTarget = null ;
this . _scrollHeight = null ;
2019-01-04 11:29:45 -05:00
} // Private
2018-11-13 01:41:12 -05:00
2021-03-23 12:26:54 -04:00
_getConfig ( config ) {
config = { ... Default ,
... ( typeof config === 'object' && config ? config : { } )
} ;
2018-11-13 01:41:12 -05:00
2020-05-13 14:53:43 -04:00
if ( typeof config . target !== 'string' && isElement ( config . target ) ) {
2021-03-23 12:26:54 -04:00
let {
id
} = config . target ;
2018-11-13 01:41:12 -05:00
if ( ! id ) {
2019-03-01 11:31:34 -05:00
id = getUID ( NAME ) ;
config . target . id = id ;
2018-07-23 20:51:14 -04:00
}
2016-01-09 03:40:51 -05:00
2021-03-23 12:26:54 -04:00
config . target = ` # ${ id } ` ;
2018-11-13 01:41:12 -05:00
}
2016-10-09 20:26:51 -04:00
2019-03-01 11:31:34 -05:00
typeCheckConfig ( NAME , config , DefaultType ) ;
2018-11-13 01:41:12 -05:00
return config ;
2021-03-23 12:26:54 -04:00
}
2015-05-11 15:05:35 -04:00
2021-03-23 12:26:54 -04:00
_getScrollTop ( ) {
2018-11-13 01:41:12 -05:00
return this . _scrollElement === window ? this . _scrollElement . pageYOffset : this . _scrollElement . scrollTop ;
2021-03-23 12:26:54 -04:00
}
2015-05-11 15:05:35 -04:00
2021-03-23 12:26:54 -04:00
_getScrollHeight ( ) {
2018-11-13 01:41:12 -05:00
return this . _scrollElement . scrollHeight || Math . max ( document . body . scrollHeight , document . documentElement . scrollHeight ) ;
2021-03-23 12:26:54 -04:00
}
2015-05-11 15:05:35 -04:00
2021-03-23 12:26:54 -04:00
_getOffsetHeight ( ) {
2018-11-13 01:41:12 -05:00
return this . _scrollElement === window ? window . innerHeight : this . _scrollElement . getBoundingClientRect ( ) . height ;
2021-03-23 12:26:54 -04:00
}
2015-05-11 15:05:35 -04:00
2021-03-23 12:26:54 -04:00
_process ( ) {
const scrollTop = this . _getScrollTop ( ) + this . _config . offset ;
2015-05-11 15:05:35 -04:00
2021-03-23 12:26:54 -04:00
const scrollHeight = this . _getScrollHeight ( ) ;
2017-09-30 17:28:03 -04:00
2021-03-23 12:26:54 -04:00
const maxScroll = this . _config . offset + scrollHeight - this . _getOffsetHeight ( ) ;
2017-09-30 17:28:03 -04:00
2018-11-13 01:41:12 -05:00
if ( this . _scrollHeight !== scrollHeight ) {
this . refresh ( ) ;
}
2017-09-30 17:28:03 -04:00
2018-11-13 01:41:12 -05:00
if ( scrollTop >= maxScroll ) {
2021-03-23 12:26:54 -04:00
const target = this . _targets [ this . _targets . length - 1 ] ;
2015-05-11 15:05:35 -04:00
2018-11-13 01:41:12 -05:00
if ( this . _activeTarget !== target ) {
this . _activate ( target ) ;
2018-07-23 20:51:14 -04:00
}
2015-05-11 15:05:35 -04:00
2018-11-13 01:41:12 -05:00
return ;
}
2018-07-23 20:51:14 -04:00
2018-11-13 01:41:12 -05:00
if ( this . _activeTarget && scrollTop < this . _offsets [ 0 ] && this . _offsets [ 0 ] > 0 ) {
this . _activeTarget = null ;
2017-09-30 17:28:03 -04:00
2018-11-13 01:41:12 -05:00
this . _clear ( ) ;
2018-06-22 01:55:23 -04:00
2018-11-13 01:41:12 -05:00
return ;
}
2015-05-11 15:05:35 -04:00
2021-03-23 12:26:54 -04:00
for ( let i = this . _offsets . length ; i -- ; ) {
const isActiveTarget = this . _activeTarget !== this . _targets [ i ] && scrollTop >= this . _offsets [ i ] && ( typeof this . _offsets [ i + 1 ] === 'undefined' || scrollTop < this . _offsets [ i + 1 ] ) ;
2017-09-30 17:28:03 -04:00
2018-11-13 01:41:12 -05:00
if ( isActiveTarget ) {
this . _activate ( this . _targets [ i ] ) ;
}
}
2021-03-23 12:26:54 -04:00
}
2017-09-30 17:28:03 -04:00
2021-03-23 12:26:54 -04:00
_activate ( target ) {
2018-11-13 01:41:12 -05:00
this . _activeTarget = target ;
2017-09-30 17:28:03 -04:00
2018-11-13 01:41:12 -05:00
this . _clear ( ) ;
2017-09-30 17:28:03 -04:00
2021-03-23 12:26:54 -04:00
const queries = this . _selector . split ( ',' ) . map ( selector => ` ${ selector } [data-bs-target=" ${ target } "], ${ selector } [href=" ${ target } "] ` ) ;
2018-11-24 11:22:59 -05:00
2021-03-23 12:26:54 -04:00
const link = SelectorEngine _ _default [ 'default' ] . findOne ( queries . join ( ',' ) ) ;
2017-09-30 17:28:03 -04:00
2020-03-28 06:29:08 -04:00
if ( link . classList . contains ( CLASS _NAME _DROPDOWN _ITEM ) ) {
2020-09-14 11:12:06 -04:00
SelectorEngine _ _default [ 'default' ] . findOne ( SELECTOR _DROPDOWN _TOGGLE , link . closest ( SELECTOR _DROPDOWN ) ) . classList . add ( CLASS _NAME _ACTIVE ) ;
2020-03-28 06:29:08 -04:00
link . classList . add ( CLASS _NAME _ACTIVE ) ;
2018-11-13 01:41:12 -05:00
} else {
// Set triggered link as active
2020-03-28 06:29:08 -04:00
link . classList . add ( CLASS _NAME _ACTIVE ) ;
2021-03-23 12:26:54 -04:00
SelectorEngine _ _default [ 'default' ] . parents ( link , SELECTOR _NAV _LIST _GROUP ) . forEach ( listGroup => {
2019-03-01 11:31:34 -05:00
// Set triggered links parents as active
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
2021-03-23 12:26:54 -04:00
SelectorEngine _ _default [ 'default' ] . prev ( listGroup , ` ${ SELECTOR _NAV _LINKS } , ${ SELECTOR _LIST _ITEMS } ` ) . forEach ( item => item . classList . add ( CLASS _NAME _ACTIVE ) ) ; // Handle special case when .nav-link is inside .nav-item
SelectorEngine _ _default [ 'default' ] . prev ( listGroup , SELECTOR _NAV _ITEMS ) . forEach ( navItem => {
SelectorEngine _ _default [ 'default' ] . children ( navItem , SELECTOR _NAV _LINKS ) . forEach ( item => item . classList . add ( CLASS _NAME _ACTIVE ) ) ;
2019-03-01 11:31:34 -05:00
} ) ;
} ) ;
2018-11-13 01:41:12 -05:00
}
2016-10-09 20:26:51 -04:00
2020-09-14 11:12:06 -04:00
EventHandler _ _default [ 'default' ] . trigger ( this . _scrollElement , EVENT _ACTIVATE , {
2018-11-13 01:41:12 -05:00
relatedTarget : target
} ) ;
2021-03-23 12:26:54 -04:00
}
2016-10-09 20:26:51 -04:00
2021-03-23 12:26:54 -04:00
_clear ( ) {
SelectorEngine _ _default [ 'default' ] . find ( this . _selector ) . filter ( node => node . classList . contains ( CLASS _NAME _ACTIVE ) ) . forEach ( node => node . classList . remove ( CLASS _NAME _ACTIVE ) ) ;
2019-01-04 11:29:45 -05:00
} // Static
2017-09-30 17:28:03 -04:00
2021-03-23 12:26:54 -04:00
static jQueryInterface ( config ) {
2018-11-13 01:41:12 -05:00
return this . each ( function ( ) {
2021-03-23 12:26:54 -04:00
let data = Data _ _default [ 'default' ] . get ( this , DATA _KEY ) ;
2017-09-30 17:28:03 -04:00
2021-03-23 12:26:54 -04:00
const _config = typeof config === 'object' && config ;
2017-09-30 17:28:03 -04:00
2018-11-13 01:41:12 -05:00
if ( ! data ) {
data = new ScrollSpy ( this , _config ) ;
}
2018-07-23 20:51:14 -04:00
2018-11-13 01:41:12 -05:00
if ( typeof config === 'string' ) {
if ( typeof data [ config ] === 'undefined' ) {
2021-03-23 12:26:54 -04:00
throw new TypeError ( ` No method named " ${ config } " ` ) ;
2017-09-06 00:05:12 -04:00
}
2017-09-30 17:28:03 -04:00
2018-11-13 01:41:12 -05:00
data [ config ] ( ) ;
2017-09-30 17:28:03 -04:00
}
2018-11-13 01:41:12 -05:00
} ) ;
2021-03-23 12:26:54 -04:00
}
2015-05-11 15:05:35 -04:00
2021-03-23 12:26:54 -04:00
}
2018-11-13 01:41:12 -05:00
/ * *
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
* Data Api implementation
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
* /
2015-05-11 15:05:35 -04:00
2017-09-30 17:28:03 -04:00
2021-03-23 12:26:54 -04:00
EventHandler _ _default [ 'default' ] . on ( window , EVENT _LOAD _DATA _API , ( ) => {
SelectorEngine _ _default [ 'default' ] . find ( SELECTOR _DATA _SPY ) . forEach ( spy => new ScrollSpy ( spy , Manipulator _ _default [ 'default' ] . getDataAttributes ( spy ) ) ) ;
2018-11-13 01:41:12 -05:00
} ) ;
/ * *
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
* jQuery
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
2020-11-11 12:07:37 -05:00
* add . ScrollSpy to jQuery only if jQuery is present
2018-11-13 01:41:12 -05:00
* /
2015-05-11 15:05:35 -04:00
2021-02-10 11:14:51 -05:00
defineJQueryPlugin ( NAME , ScrollSpy ) ;
2015-05-11 15:05:35 -04:00
return ScrollSpy ;
2018-07-23 20:51:14 -04:00
2019-11-08 03:11:23 -05:00
} ) ) ) ;
2018-07-23 20:51:14 -04:00
//# sourceMappingURL=scrollspy.js.map