Loading gin_toolbar.module +23 −3 Original line number Diff line number Diff line Loading @@ -42,9 +42,17 @@ function gin_toolbar_preprocess_html(&$variables) { return; } $module_handler = \Drupal::service('module_handler'); // Check for new Drupal navigation if ($module_handler->moduleExists('navigation')) { // Set toolbar class. $variables['attributes']['class'][] = 'gin--navigation'; } else { // Set toolbar class. $variables['attributes']['class'][] = 'gin--' . $toolbar . '-toolbar'; } } /** * Implements hook_preprocess_HOOK() for page_attachments. Loading @@ -58,7 +66,15 @@ function gin_toolbar_page_attachments_alter(&$page) { // Get theme settings. /** @var \Drupal\gin\GinSettings $settings */ $settings = \Drupal::classResolver(GinSettings::class); $module_handler = \Drupal::service('module_handler'); // Check for new Drupal navigation if ($module_handler->moduleExists('navigation')) { // Set toolbar class. $toolbar = 'new'; } else { $toolbar = $settings->get('classic_toolbar'); } // Attach the base library. $page['#attached']['library'][] = 'gin/gin_base'; Loading @@ -74,6 +90,10 @@ function gin_toolbar_page_attachments_alter(&$page) { // Attach the horizontal toolbar styles. $page['#attached']['library'][] = 'gin/gin_horizontal_toolbar'; } elseif ($toolbar === 'new') { // Attach the new drupal navigation styles. $page['#attached']['library'][] = 'gin/navigation'; } else { // Attach toolbar styles. $page['#attached']['library'][] = 'gin/gin_toolbar'; Loading Loading
gin_toolbar.module +23 −3 Original line number Diff line number Diff line Loading @@ -42,9 +42,17 @@ function gin_toolbar_preprocess_html(&$variables) { return; } $module_handler = \Drupal::service('module_handler'); // Check for new Drupal navigation if ($module_handler->moduleExists('navigation')) { // Set toolbar class. $variables['attributes']['class'][] = 'gin--navigation'; } else { // Set toolbar class. $variables['attributes']['class'][] = 'gin--' . $toolbar . '-toolbar'; } } /** * Implements hook_preprocess_HOOK() for page_attachments. Loading @@ -58,7 +66,15 @@ function gin_toolbar_page_attachments_alter(&$page) { // Get theme settings. /** @var \Drupal\gin\GinSettings $settings */ $settings = \Drupal::classResolver(GinSettings::class); $module_handler = \Drupal::service('module_handler'); // Check for new Drupal navigation if ($module_handler->moduleExists('navigation')) { // Set toolbar class. $toolbar = 'new'; } else { $toolbar = $settings->get('classic_toolbar'); } // Attach the base library. $page['#attached']['library'][] = 'gin/gin_base'; Loading @@ -74,6 +90,10 @@ function gin_toolbar_page_attachments_alter(&$page) { // Attach the horizontal toolbar styles. $page['#attached']['library'][] = 'gin/gin_horizontal_toolbar'; } elseif ($toolbar === 'new') { // Attach the new drupal navigation styles. $page['#attached']['library'][] = 'gin/navigation'; } else { // Attach toolbar styles. $page['#attached']['library'][] = 'gin/gin_toolbar'; Loading