Skip to content

Instantly share code, notes, and snippets.

@wesruv
Created May 13, 2017 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wesruv/c0291fe03a03be15585047de08078503 to your computer and use it in GitHub Desktop.
Save wesruv/c0291fe03a03be15585047de08078503 to your computer and use it in GitHub Desktop.
Drupal 7 JS File Starter
/**
* @file
* A JavaScript file that does stuff.
*/
// JavaScript should be made compatible with libraries other than jQuery by
// wrapping it with an "anonymous closure". See:
// - https://drupal.org/node/1446420
// - http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth
(function ($) {
'use strict';
Drupal.behaviors.componentName = {
attach: function (context) {
}
}
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment