Skip to content

Instantly share code, notes, and snippets.

@tommymarshall
Last active August 29, 2015 14:04
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 tommymarshall/eed1039eb8fe16691052 to your computer and use it in GitHub Desktop.
Save tommymarshall/eed1039eb8fe16691052 to your computer and use it in GitHub Desktop.
Example of how to do things
//= require_tree .
PROJECT.global.init();
// All the files in the tree here:
// global.js
var PROJECT = PROJECT || {};
var global = PROJECT.global = {
init: function() {
PROJECT.betForm.init();
PROJECT.carousel.init();
}
};
// betForm.js
var PROJECT = PROJECT || {};
PROJECT.betForm = {
init: function() {
this.setVars();
this.bindEvents();
},
setVars: function() {
this.$form = $('.form');
},
bindEvents: function() {
this.$form.on('click', this.open);
},
open: function() {
// Opens the form
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment