create and configure callback handlers for state updates

add $.Dispatch to handle object events
add subscribe calls to files
update SM fireUpdate to use new Dispatch

There are some NaN issues right now, no time to bug hunt right now, it
does kind of function though
This commit is contained in:
LucidCrux
2013-07-24 18:27:04 -06:00
parent dee7cbb9b3
commit 2018ca3ae8
9 changed files with 105 additions and 69 deletions
+5 -5
View File
@@ -41,6 +41,9 @@ var Space = {
var h = $('<div>').attr('id', 'hullRemaining').appendTo(this.panel);
$('<div>').addClass('row_key').text('hull: ').appendTo(h);
$('<div>').addClass('row_val').appendTo(h);
//subscribe to stateUpdates
$.Dispatch('stateUpdate').subscribe(Space.handleStateUpdates);
},
options: {}, // Nothing for now
@@ -449,8 +452,5 @@ var Space = {
handleStateUpdates: function(e){
},
};
//listener for StateManager update events
$(Space).on('stateUpdate', Space.handleStateUpdates);
}
};