You are here

function pace_preprocess_html in PACE - Page load progress bar 2.0.x

Same name and namespace in other branches
  1. 8 pace.module \pace_preprocess_html()
  2. 7 pace.module \pace_preprocess_html()

Implements template_preprocess_html().

File

./pace.module, line 13
Loads PACE js.

Code

function pace_preprocess_html(&$variables) {

  // Check if PACE is disabled for admin pages and don't load it.
  if (!\Drupal::config('pace.settings')
    ->get('pace_load_on_admin_enabled')) {
    $is_admin = \Drupal::service('router.admin_context')
      ->isAdminRoute();
    if (!$is_admin) {
      load_pace($variables);
    }
  }
  else {
    load_pace($variables);
  }
}