WOW somehow got it to work with events being a module export

This commit is contained in:
Peter Cottle 2012-12-09 22:20:29 -08:00
parent 6327566a63
commit 7ef0d19e12
7 changed files with 70 additions and 46 deletions

View file

@ -1,3 +1,5 @@
var Main = require('./main');
var Collections = require('./collections');
var CommitCollection = Collections.CommitCollection;
var BranchCollection = Collections.BranchCollection;
@ -88,7 +90,7 @@ function GitVisuals(options) {
this.branchCollection.on('remove', this.removeBranch, this);
this.deferred = [];
events.on('refreshTree', _.bind(
Main.getEvents().on('refreshTree', _.bind(
this.refreshTree, this
));
}
@ -531,7 +533,7 @@ GitVisuals.prototype.calcDepthRecursive = function(commit, depth) {
GitVisuals.prototype.canvasResize = function(width, height) {
// refresh when we are ready
if (GLOBAL.isAnimating) {
events.trigger('processCommandFromEvent', 'refresh');
Main.getEvents().trigger('processCommandFromEvent', 'refresh');
} else {
this.refreshTree();
}