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