mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 16:38:50 +02:00
god damn took so long but now rebase is almost done
This commit is contained in:
parent
359878037a
commit
6e30bedd37
3 changed files with 101 additions and 9 deletions
32
src/tree.js
32
src/tree.js
|
@ -504,6 +504,14 @@ var VisNode = Backbone.Model.extend({
|
|||
this.animateToAttr(toAttr, speed, easing);
|
||||
},
|
||||
|
||||
animateToSnapshot: function(snapShot, speed, easing) {
|
||||
console.log('animating to snapshot', snapShot, this.getID());
|
||||
if (!snapShot[this.getID()]) {
|
||||
return;
|
||||
}
|
||||
this.animateToAttr(snapShot[this.getID()], speed, easing);
|
||||
},
|
||||
|
||||
animateToAttr: function(attr, speed, easing) {
|
||||
var func = 'animate';
|
||||
if (speed == 0) {
|
||||
|
@ -579,6 +587,12 @@ var VisNode = Backbone.Model.extend({
|
|||
this.setOutgoingEdgesBirthPosition(this.getParentScreenCoords());
|
||||
},
|
||||
|
||||
setOutgoingEdgesOpacity: function(opacity) {
|
||||
_.each(this.get('outgoingEdges'), function(edge) {
|
||||
edge.setOpacity(opacity);
|
||||
});
|
||||
},
|
||||
|
||||
animateOutgoingEdgesToAttr: function(snapShot, speed, easing) {
|
||||
_.each(this.get('outgoingEdges'), function(edge) {
|
||||
var attr = snapShot[edge.getID()];
|
||||
|
@ -650,6 +664,18 @@ var VisNode = Backbone.Model.extend({
|
|||
});
|
||||
},
|
||||
|
||||
setOpacity: function(opacity) {
|
||||
opacity = (opacity === undefined) ? 1 : opacity;
|
||||
|
||||
// set the opacity on my stuff
|
||||
var keys = ['circle', 'text'];
|
||||
_.each(keys, function(key) {
|
||||
this.get(key).attr({
|
||||
opacity: opacity
|
||||
});
|
||||
}, this);
|
||||
},
|
||||
|
||||
genGraphics: function(paper) {
|
||||
var pos = this.getScreenCoords();
|
||||
var textPos = this.getTextScreenCoords();
|
||||
|
@ -768,6 +794,12 @@ var VisEdge = Backbone.Model.extend({
|
|||
return GRAPHICS.visBranchStrokeColorNone;
|
||||
},
|
||||
|
||||
setOpacity: function(opacity) {
|
||||
opacity = (opacity === undefined) ? 1 : opacity;
|
||||
|
||||
this.get('path').attr({opacity: opacity});
|
||||
},
|
||||
|
||||
genGraphics: function(paper) {
|
||||
var pathString = this.getBezierCurve();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue