You are here

function page_load_progress_init in Page Load Progress 7

Implements hook_init().

File

./page_load_progress.module, line 42
Page Load Progress allows you to set a screen lock showing a spinner when the user clicks on an element that triggers a time consuming task.

Code

function page_load_progress_init() {
  if (0 !== strpos(current_path(), 'admin/structure/views/')) {
    $settings = array(
      'delay' => variable_get('page_load_progress_time', 10),
      'elements' => variable_get('page_load_progress_elements', '.form-submit'),
    );
    drupal_add_js(array(
      'page_load_progress' => $settings,
    ), 'setting');
    drupal_add_js(drupal_get_path('module', 'page_load_progress') . '/js/page_load_progress.js', 'file');
  }
}