more glue stuff

This commit is contained in:
Peter Cottle 2012-11-03 13:53:37 -07:00
parent ca3c0f2b3f
commit e412be9b61
2 changed files with 42 additions and 37 deletions

View file

@ -1,34 +1,35 @@
function Visualization(options) {
var Visualization = Backbone.View.extend({
initialize: function(options) {
var _this = this;
Raphael(10, 10, 200, 200, function() {
// for some reason raphael calls this function with a predefined
// context...
// so switch it
paper = this;
_this.paperInitialize(this);
});
},
var _this = this;
Raphael(10, 10, 200, 200, function() {
// for some reason raphael calls this function with a predefined
// context...
// so switch it
paper = this;
_this.initialize(this);
});
}
paperInitialize: function(paper, options) {
this.commitCollection = new CommitCollection();
this.branchCollection = new BranchCollection();
Visualization.prototype.initialize = function(paper, options) {
this.commitCollection = new CommitCollection();
this.branchCollection = new BranchCollection();
gitVisuals = new GitVisuals({
commitCollection: this.commitCollection,
branchCollection: this.branchCollection
});
gitVisuals = new GitVisuals({
commitCollection: this.commitCollection,
branchCollection: this.branchCollection
});
gitEngine = new GitEngine({
collection: this.commitCollection,
branches: this.branchCollection
});
gitEngine = new GitEngine({
collection: this.commitCollection,
branches: this.branchCollection
});
// needs to be called before raphael ready
windowResize();
events.trigger('raphaelReady');
}
// needs to be called before raphael ready
windowResize();
events.trigger('raphaelReady');
}
});
function GitVisuals(options) {
this.commitCollection = options.commitCollection;