You are here

function node_revision_delete_js_alter in Node Revision Delete 7.3

Same name and namespace in other branches
  1. 7.2 node_revision_delete.module \node_revision_delete_js_alter()

Implements hook_js_alter().

File

./node_revision_delete.module, line 229

Code

function node_revision_delete_js_alter(&$javascript) {

  // Deleting the library because we have our own version.
  // Maybe this cannot be longer needed once https://www.drupal.org/node/2871619
  // will be fixed.
  // Getting the core js file.
  $core_file = drupal_get_path('module', 'node') . '/content_types.js';

  // Replacing the file.
  if (isset($javascript[$core_file])) {

    // Getting the module js file.
    $module_file = drupal_get_path('module', 'node_revision_delete') . '/js/content_types.js';

    // Overwriting the file.
    $javascript[$core_file] = drupal_js_defaults($module_file);
  }
}