Skip to content

Instantly share code, notes, and snippets.

@phamann
Created October 18, 2012 09:21
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 phamann/3910643 to your computer and use it in GitHub Desktop.
Save phamann/3910643 to your computer and use it in GitHub Desktop.
UTIL = {
exec: function( controller, action ) {
var ns = SITENAME,
action = ( action === undefined ) ? "init" : action;
if ( controller !== "" && ns[controller] && typeof ns[controller][action] == "function" ) {
ns[controller][action]();
}
},
init: function() {
var body = document.body,
controller = body.getAttribute( "data-controller" ),
action = body.getAttribute( "data-action" );
UTIL.exec( "common" );
UTIL.exec( controller );
UTIL.exec( controller, action );
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment