You are here

function pagestyle_js_alter in Page Style 7

Implement hook_js_alter().

Removes any JavaScript added if we want textsize disabled on the admin theme AND we're currently using the admin theme.

Parameters

$javascript:

File

./pagestyle.module, line 439
Display a style changer on the page and in the browser menu for a better web accessibility.

Code

function pagestyle_js_alter(&$javascript) {
  if (pagestyle_admin_theme_check()) {

    // Unset the JS added with key
    $key = drupal_get_path('module', 'pagestyle') . '/jquery.pagestyle.js';
    unset($javascript[$key]);

    // Check any inline JS added with a numeric key
    foreach ($javascript as $key => $js) {
      if (!is_array($javascript[$key]['data']) && strpos($javascript[$key]['data'], 'pagestyle')) {
        unset($javascript[$key]);
      }
    }
  }
}