mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-26 07:58:34 +02:00
makes other vis now too
This commit is contained in:
parent
9173e75c1a
commit
29d401e701
4 changed files with 147 additions and 18 deletions
|
@ -49,7 +49,8 @@ var Visualization = Backbone.View.extend({
|
|||
branchCollection: this.branchCollection,
|
||||
paper: this.paper,
|
||||
noClick: this.options.noClick,
|
||||
smallCanvas: this.options.smallCanvas
|
||||
smallCanvas: this.options.smallCanvas,
|
||||
visualization: this
|
||||
});
|
||||
|
||||
var GitEngine = require('../git').GitEngine;
|
||||
|
@ -85,6 +86,24 @@ var Visualization = Backbone.View.extend({
|
|||
this.customEvents.trigger('paperReady');
|
||||
},
|
||||
|
||||
makeOrigin: function(options) {
|
||||
// oh god, here we go. We basically do a bizarre form of composition here,
|
||||
// where this visualization actually contains another one of itself.
|
||||
this.originVis = new Visualization(_.extend(
|
||||
{},
|
||||
// copy all of our options over, except...
|
||||
this.options,
|
||||
{
|
||||
// never accept keyboard input or clicks
|
||||
noKeyboardInput: true,
|
||||
noClick: true,
|
||||
treeString: JSON.stringify(options.tree)
|
||||
}
|
||||
));
|
||||
// return the newly created gitEngine
|
||||
return this.originVis.gitEngine;
|
||||
},
|
||||
|
||||
setTreeIndex: function(level) {
|
||||
$(this.paper.canvas).css('z-index', level);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue