PopoverAnimation.php in Express 8
File
themes/contrib/bootstrap/src/Plugin/Setting/JavaScript/Popovers/PopoverAnimation.php
View source
<?php
namespace Drupal\bootstrap\Plugin\Setting\JavaScript\Popovers;
use Drupal\bootstrap\Annotation\BootstrapSetting;
use Drupal\bootstrap\Plugin\Setting\SettingBase;
use Drupal\bootstrap\Utility\Element;
use Drupal\Core\Annotation\Translation;
use Drupal\Core\Form\FormStateInterface;
class PopoverAnimation extends SettingBase {
public function alterFormElement(Element $form, FormStateInterface $form_state, $form_id = NULL) {
parent::alterFormElement($form, $form_state, $form_id);
$group = $this
->getGroupElement($form, $form_state);
$group
->setProperty('description', t('These are global options. Each popover can independently override desired settings by appending the option name to <code>data-</code>. Example: <code>data-animation="false"</code>.'));
$group
->setProperty('states', [
'visible' => [
':input[name="popover_enabled"]' => [
'checked' => TRUE,
],
],
]);
}
public function drupalSettings() {
return !!$this->theme
->getSetting('popover_enabled');
}
}