mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-26 23:04:32 +02:00
Allow constructors to accept a CSS selector (#32245)
Co-authored-by: XhmikosR <xhmikosr@gmail.com> Co-authored-by: Mark Otto <otto@github.com>
This commit is contained in:
@@ -68,7 +68,7 @@ const METHOD_POSITION = 'position'
|
||||
class ScrollSpy extends BaseComponent {
|
||||
constructor(element, config) {
|
||||
super(element)
|
||||
this._scrollElement = element.tagName === 'BODY' ? window : 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 = []
|
||||
|
Reference in New Issue
Block a user