devel_wizard-2.x-dev/templates/spell/library/js.twig

templates/spell/library/js.twig
(function (document, Drupal, once) {

  Drupal.behaviors.{{ extension.machineNameLowerCamel }}{{ library.idShortUpperCamel }} = {
    attach: function () {
      once('{{ extension.machineNameLowerCamel }}{{ library.idShortUpperCamel }}', '.nothing')
        .forEach(
          /**
           * @param {HTMLInputElement} element
           */
          function (element) {
            element.addEventListener('change', Drupal.{{ extension.machineNameLowerCamel }}{{ library.idShortUpperCamel }}.onChange);
          },
        );
    },
  };

  Drupal.{{ extension.machineNameLowerCamel }}{{ library.idShortUpperCamel }} = Drupal.{{ extension.machineNameLowerCamel }}{{ library.idShortUpperCamel }} || {};

  /**
   * @param {InputEvent} event
   */
  Drupal.{{ extension.machineNameLowerCamel }}{{ library.idShortUpperCamel }}.onChange = function (event) {
    // @todo Implement.
  };

})(document, Drupal, once);

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc