Created
February 18, 2013 21:50
-
-
Save Sigmus/4981079 to your computer and use it in GitHub Desktop.
pseudo-controler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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