diff options
| author | Johann-S <[email protected]> | 2017-08-27 00:57:27 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2019-02-20 22:05:45 +0200 |
| commit | 6b5850212e0c3a9f5f82d22eda0f6240d01f2f5a (patch) | |
| tree | d5eaa375d745dbcea74831670dcf208902fdf423 /js/src | |
| parent | b69fa9db95aa3454b59260ce099f33f07797ea6c (diff) | |
| download | bootstrap-6b5850212e0c3a9f5f82d22eda0f6240d01f2f5a.tar.xz bootstrap-6b5850212e0c3a9f5f82d22eda0f6240d01f2f5a.zip | |
Second element of find and findOne should be optional, not the first one
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/alert.js | 2 | ||||
| -rw-r--r-- | js/src/dom/selectorEngine.js | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/js/src/alert.js b/js/src/alert.js index d23c4659c..1bdd9706a 100644 --- a/js/src/alert.js +++ b/js/src/alert.js @@ -84,7 +84,7 @@ class Alert { let parent = false if (selector) { - parent = SelectorEngine.find(selector)[0] + parent = SelectorEngine.findOne(selector) } if (!parent) { diff --git a/js/src/dom/selectorEngine.js b/js/src/dom/selectorEngine.js index bef616988..0cff83ef9 100644 --- a/js/src/dom/selectorEngine.js +++ b/js/src/dom/selectorEngine.js @@ -46,19 +46,19 @@ const SelectorEngine = { return fnMatches.call(element, selector) }, - find(element = document, selector) { + find(selector, element = document) { if (typeof selector !== 'string') { return null } if (selector.indexOf('#') === 0) { - return SelectorEngine.findOne(element, selector) + return SelectorEngine.findOne(selector, element) } return element.querySelectorAll(selector) }, - findOne(element = document, selector) { + findOne(selector, element = document) { if (typeof selector !== 'string') { return null } |
