Skip to content

Instantly share code, notes, and snippets.

@Sigmus
Created February 18, 2013 21:50
Show Gist options
  • Save Sigmus/4981079 to your computer and use it in GitHub Desktop.
Save Sigmus/4981079 to your computer and use it in GitHub Desktop.
pseudo-controler
$(function() {
var action = $('[data-script]').data();
if (_.isNull(action)) { return; }
resolve(action);
function resolve() {
_.each(action.script.split(','), function(name) {
var path = '/js/admin/' + name.trim() + '.js';
require([path], function(module) {
if (_.isFunction(module)) {
module(action.params);
}
});
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment