You are here

function tipsy_page_attachments in Tipsy 8

Implements hook_page_attachments().

File

./tipsy.module, line 71
Main file for Tipsy module.

Code

function tipsy_page_attachments(array &$attachments) {
  $settings = _tipsy_get_settings();
  if ($settings['drupal_forms']['forms'] == 0) {
    unset($settings['drupal_forms']);
  }
  $settings = \Drupal::configFactory()
    ->getEditable('tipsy.settings')
    ->get("wide_settings");
  $attachments['#attached']['library'][] = 'tipsy/tipsy';
  $attachments['#attached']['drupalSettings']['tipsy'] = $settings;
}