Merge branch 'master' of github.com:johnbintz/bullseye

Merge in penchant stuff.
This commit is contained in:
John Bintz 2012-08-27 09:40:00 -04:00
commit fcb2c5bd50
1 changed files with 3 additions and 5 deletions

View File

@ -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);
}); });