mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-20 17:54:23 +01:00
Extend SelectorEngine.find()
to include an element
first arg.
If not supplied, it'll just use `document`.
This commit is contained in:
parent
3664d14908
commit
3e8bc9d9ec
@ -46,7 +46,7 @@ const SelectorEngine = {
|
||||
return fnMatches.call(element, selector)
|
||||
},
|
||||
|
||||
find(selector) {
|
||||
find(element = document, selector) {
|
||||
if (typeof selector !== 'string') {
|
||||
return null
|
||||
}
|
||||
@ -56,7 +56,7 @@ const SelectorEngine = {
|
||||
selectorType = 'getElementById'
|
||||
selector = selector.substr(1, selector.length)
|
||||
}
|
||||
return document[selectorType](selector)
|
||||
return element[selectorType](selector)
|
||||
},
|
||||
|
||||
closest(element, selector) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user