Updated the Bootstrap theme.
[yaffs-website] / web / themes / contrib / bootstrap / src / Plugin / Setting / JavaScript / Popovers / PopoverAutoClose.php
diff --git a/web/themes/contrib/bootstrap/src/Plugin/Setting/JavaScript/Popovers/PopoverAutoClose.php b/web/themes/contrib/bootstrap/src/Plugin/Setting/JavaScript/Popovers/PopoverAutoClose.php
new file mode 100644 (file)
index 0000000..fd23b3f
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+namespace Drupal\bootstrap\Plugin\Setting\JavaScript\Popovers;
+
+use Drupal\bootstrap\Plugin\Setting\SettingBase;
+
+/**
+ * The "popover_trigger_autoclose" theme setting.
+ *
+ * @ingroup plugins_setting
+ *
+ * @BootstrapSetting(
+ *   id = "popover_auto_close",
+ *   type = "checkbox",
+ *   title = @Translation("autoClose"),
+ *   description = @Translation("If enabled, the active popover will automatically close when it loses focus, when a click occurs anywhere in the DOM (outside the popover), the escape key (ESC) is pressed or when another popover is opened."),
+ *   defaultValue = 1,
+ *   groups = {
+ *     "javascript" = @Translation("JavaScript"),
+ *     "popovers" = @Translation("Popovers"),
+ *     "options" = @Translation("Options"),
+ *   },
+ * )
+ */
+class PopoverAutoClose extends SettingBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function drupalSettings() {
+    return !!$this->theme->getSetting('popover_enabled');
+  }
+
+}