diff options
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; } |