TooltipEnabled.php in Express 8
File
themes/contrib/bootstrap/src/Plugin/Setting/JavaScript/Tooltips/TooltipEnabled.php
View source
<?php
namespace Drupal\bootstrap\Plugin\Setting\JavaScript\Tooltips;
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 TooltipEnabled 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('Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don\'t rely on images, use CSS3 for animations, and data-attributes for local title storage. See <a href=":url" target="_blank">Bootstrap tooltips</a> for more documentation.', [
':url' => 'http://getbootstrap.com/javascript/#tooltips',
]));
}
public function drupalSettings() {
return !!$this->theme
->getSetting('tooltip_enabled');
}
}