bullseye/app/assets/javascripts/bullseye.js

23 lines
527 B
JavaScript
Raw Normal View History

2012-08-23 12:43:06 +00:00
#= require jquery
this.Bullseye = {
target: function(controller, action, callback) {
this.targets[controller] = (this.targets[controller] || {});
this.targets[controller][action] = callback;
},
2012-08-27 01:33:39 +00:00
targets: {},
2012-08-23 12:43:06 +00:00
exec: function(controller, action) {
if (this.targets[controller] && this.targets[controller][action]) {
this.targets[controller][action].apply(this.context);
}
}
};
Bullseye.context = this;
$(function() {
2012-08-27 01:33:39 +00:00
Bullseye.exec($('body').data('controller'), $('body').data('action'));
2012-08-23 12:43:06 +00:00
});