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

github.com/twbs/bootstrap-rubygem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'assets/javascripts/bootstrap.js')
-rw-r--r--assets/javascripts/bootstrap.js26
1 files changed, 25 insertions, 1 deletions
diff --git a/assets/javascripts/bootstrap.js b/assets/javascripts/bootstrap.js
index 42ea8e7..b3288b2 100644
--- a/assets/javascripts/bootstrap.js
+++ b/assets/javascripts/bootstrap.js
@@ -918,7 +918,10 @@ var Carousel = (function ($) {
if (typeof config === 'number') {
data.to(config);
- } else if (action) {
+ } else if (typeof action === 'string') {
+ if (data[action] === undefined) {
+ throw new Error('No method named "' + action + '"');
+ }
data[action]();
} else if (_config.interval) {
data.pause();
@@ -1306,6 +1309,9 @@ var Collapse = (function ($) {
}
if (typeof config === 'string') {
+ if (data[config] === undefined) {
+ throw new Error('No method named "' + config + '"');
+ }
data[config]();
}
});
@@ -1496,6 +1502,9 @@ var Dropdown = (function ($) {
}
if (typeof config === 'string') {
+ if (data[config] === undefined) {
+ throw new Error('No method named "' + config + '"');
+ }
data[config].call(this);
}
});
@@ -2093,6 +2102,9 @@ var Modal = (function ($) {
}
if (typeof config === 'string') {
+ if (data[config] === undefined) {
+ throw new Error('No method named "' + config + '"');
+ }
data[config](relatedTarget);
} else if (_config.show) {
data.show(relatedTarget);
@@ -2429,6 +2441,9 @@ var ScrollSpy = (function ($) {
}
if (typeof config === 'string') {
+ if (data[config] === undefined) {
+ throw new Error('No method named "' + config + '"');
+ }
data[config]();
}
});
@@ -2692,6 +2707,9 @@ var Tab = (function ($) {
}
if (typeof config === 'string') {
+ if (data[config] === undefined) {
+ throw new Error('No method named "' + config + '"');
+ }
data[config]();
}
});
@@ -3283,6 +3301,9 @@ var Tooltip = (function ($) {
}
if (typeof config === 'string') {
+ if (data[config] === undefined) {
+ throw new Error('No method named "' + config + '"');
+ }
data[config]();
}
});
@@ -3468,6 +3489,9 @@ var Popover = (function ($) {
}
if (typeof config === 'string') {
+ if (data[config] === undefined) {
+ throw new Error('No method named "' + config + '"');
+ }
data[config]();
}
});