ensure targets are available
This commit is contained in:
parent
f31dd0f3d4
commit
7c1b4b1ca5
|
@ -2,11 +2,12 @@
|
|||
|
||||
this.Bullseye = {
|
||||
target: function(controller, action, callback) {
|
||||
this.targets = (this.targets || {});
|
||||
this.targets[controller] = (this.targets[controller] || {});
|
||||
this.targets[controller][action] = callback;
|
||||
},
|
||||
|
||||
targets: {},
|
||||
|
||||
exec: function(controller, action) {
|
||||
if (this.targets[controller] && this.targets[controller][action]) {
|
||||
this.targets[controller][action].apply(this.context);
|
||||
|
@ -17,8 +18,5 @@ this.Bullseye = {
|
|||
Bullseye.context = this;
|
||||
|
||||
$(function() {
|
||||
var controller = $('body').data('controller');
|
||||
var action = $('body').data('action');
|
||||
|
||||
Bullseye.exec(controller, action);
|
||||
Bullseye.exec($('body').data('controller'), $('body').data('action'));
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue