summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Carver2017-07-01 12:00:55 -0600
committerMark Carver2017-07-01 12:00:55 -0600
commit99e5a4036b83b560d68fdb121a7c229603e2d9f7 (patch)
tree0208cbbaab5cb622fa8a8c2cac45d3f2474f75cf
parentfd8fde2b8c134b814a13806d30dab4497030ef7d (diff)
Issue #2883951 by nsciacca, markcarver: Recent update for popovers breaks site that doesn't use them
-rw-r--r--js/popover.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/js/popover.js b/js/popover.js
index 7f606f8..198cd3e 100644
--- a/js/popover.js
+++ b/js/popover.js
@@ -15,6 +15,7 @@ var Drupal = Drupal || {};
return {
DEFAULTS: {
animation: !!settings.popover_animation,
+ enabled: settings.popover_enabled,
html: !!settings.popover_html,
placement: settings.popover_placement,
selector: settings.popover_selector,
@@ -35,6 +36,10 @@ var Drupal = Drupal || {};
*/
Drupal.behaviors.bootstrapPopovers = {
attach: function (context) {
+ // Immediately return if popovers are not available.
+ if (!$.fn.popover || !$.fn.popover.Constructor.DEFAULTS.enabled) {
+ return;
+ }
// Popover autoclose.
if ($.fn.popover.Constructor.DEFAULTS.triggerAutoclose) {
@@ -102,6 +107,11 @@ var Drupal = Drupal || {};
}
},
detach: function (context) {
+ // Immediately return if popovers are not available.
+ if (!$.fn.popover || !$.fn.popover.Constructor.DEFAULTS.enabled) {
+ return;
+ }
+
// Destroy all popovers.
$(context).find('[data-toggle="popover"]')
.off('click.drupal.bootstrap.popover')