Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Latest commit

 

History

History
31 lines (21 loc) · 571 Bytes

javascript.md

File metadata and controls

31 lines (21 loc) · 571 Bytes

JavaScript

  • Files MUST be stored in module's js directory.

  • JS files MUST be named as a module name with underscored replaced by

    dashes. E.g, my_module => my­-module.js.

  • More specific JS files SHOULD be included separately and named

    with .my-feature suffix. I.e. my-module.my-feature.js.

  • Use the following template as a scaffolding code:

/**
 * @file
 *
 */

/*global jQuery, Drupal*/

(function ($) {
  'use strict';
  Drupal.behaviors.my_module = {
    attach: function (context) {

    }
  };
}(jQuery));