mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-15 11:59:39 +03:00
Extend SelectorEngine.find() to include an element first arg.
If not supplied, it'll just use `document`.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user