Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <markdotto@gmail.com>2018-08-19 06:22:08 +0300
committerMark Otto <markdotto@gmail.com>2018-08-19 06:22:08 +0300
commitc0fd91788ee16ef013fe7201c069cfcfef7d0af9 (patch)
tree9f2992512c0015338dd804131cbcdba348b4535b /dist/js/bootstrap.js
parentab7ce480f254d70dba1a47a955897d0c29e660bf (diff)
dist
Diffstat (limited to 'dist/js/bootstrap.js')
-rw-r--r--dist/js/bootstrap.js14
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;
}