summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornsciacca2017-07-01 11:51:13 -0600
committerMark Carver2017-07-01 11:51:13 -0600
commit6d0c86a4b29b7505dc309f24cb4a997e3726a9fb (patch)
tree16e3eef3d86268ead6e5fee0c9b4025d8fd9762c
parent0b792fd5aaa2c602f4ec070fd9403de0008298bd (diff)
Issue #2883951 by nsciacca, markcarver: Recent update for popovers breaks site that doesn't use them
-rw-r--r--js/bootstrap.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/js/bootstrap.js b/js/bootstrap.js
index 5103625..7138953 100644
--- a/js/bootstrap.js
+++ b/js/bootstrap.js
@@ -76,7 +76,8 @@ var Drupal = Drupal || {};
*/
Drupal.behaviors.bootstrapPopovers = {
attach: function (context, settings) {
- if (!settings.bootstrap || !settings.bootstrap.popoverEnabled) {
+ // Immediately return if popovers are not available.
+ if (!settings.bootstrap || !settings.bootstrap.popoverEnabled || !$.fn.popover) {
return;
}
@@ -145,7 +146,12 @@ var Drupal = Drupal || {};
}
}
},
- detach: function (context) {
+ detach: function (context, settings) {
+ // Immediately return if popovers are not available.
+ if (!settings.bootstrap || !settings.bootstrap.popoverEnabled || !$.fn.popover) {
+ return;
+ }
+
// Destroy all popovers.
$(context).find('[data-toggle="popover"]')
.off('click.drupal.bootstrap.popover')