diff options
author | Mark Otto <markdotto@gmail.com> | 2018-08-19 06:22:08 +0300 |
---|---|---|
committer | Mark Otto <markdotto@gmail.com> | 2018-08-19 06:22:08 +0300 |
commit | c0fd91788ee16ef013fe7201c069cfcfef7d0af9 (patch) | |
tree | 9f2992512c0015338dd804131cbcdba348b4535b /dist/js/bootstrap.js | |
parent | ab7ce480f254d70dba1a47a955897d0c29e660bf (diff) |
dist
Diffstat (limited to 'dist/js/bootstrap.js')
-rw-r--r-- | dist/js/bootstrap.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index af3e1bf0b3..fe19a1086e 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -141,13 +141,21 @@ }, getSelectorFromElement: function getSelectorFromElement(element) { var selector = element.getAttribute('data-target'); + var method = 'querySelector'; if (!selector || selector === '#') { - selector = element.getAttribute('href') || ''; + selector = (element.getAttribute('href') || '').trim(); + } + + var validSelector = selector; + + if (selector.charAt(0) === '#' && selector.indexOf(',') === -1) { + selector = selector.substr(1); + method = 'getElementById'; } try { - return document.querySelector(selector) ? selector : null; + return document[method](selector) ? validSelector : null; } catch (err) { return null; } @@ -3260,7 +3268,7 @@ var _config = typeof config === 'object' ? config : null; - if (!data && /destroy|hide/.test(config)) { + if (!data && /dispose|hide/.test(config)) { return; } |