Skip to content

Instantly share code, notes, and snippets.

@greypants
Created May 21, 2013 21:41
Show Gist options
  • Save greypants/5623487 to your computer and use it in GitHub Desktop.
Save greypants/5623487 to your computer and use it in GitHub Desktop.
JS: Garber-Irish-Tello
APP = {
init: function() {
// Check for controller and action js
var body = document.body;
var controllerJs = this[body.getAttribute("data-controller")];
var actionJs = controllerJs ? controllerJs[body.getAttribute("data-action")] : false;
// Cache global vars
this.$body = $(body);
// init all the things!
this.global.init();
this.exec(this.global);
this.exec(controllerJs);
this.exec(actionJs);
},
exec: function(method) {
method && method.init && method.init();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment