You are here

function js_element_info_alter in JS Callback Handler 8.3

Same name and namespace in other branches
  1. 7.2 js.module \js_element_info_alter()

Implements hook_element_info_alter().

File

./js.module, line 15
JS Callback Handler module.

Code

function js_element_info_alter(array &$info) {
  foreach (array_keys($info) as $type) {
    if (!isset($info[$type]['#pre_render'])) {
      $info[$type]['#pre_render'] = [];
    }
    array_unshift($info[$type]['#pre_render'], 'js.callback:preRenderJsCallback');
    if (!isset($info[$type]['#process'])) {
      $info[$type]['#process'] = [];
    }
    array_unshift($info[$type]['#process'], '\\Drupal\\js\\Js::processJsCallback');
  }
}