mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 08:28:50 +02:00
big finish on the rebase animation
This commit is contained in:
parent
b106e22ac3
commit
311e429ba3
4 changed files with 59 additions and 49 deletions
19
src/tree.js
19
src/tree.js
|
@ -320,10 +320,10 @@ var VisBranch = Backbone.Model.extend({
|
|||
|
||||
animateUpdatedPos: function(speed, easing) {
|
||||
var attr = this.getAttributes();
|
||||
this.animateFromAttributes(speed, easing, attr);
|
||||
this.animateFromAttr(attr, speed, easing);
|
||||
},
|
||||
|
||||
animateFromAttributes: function(speed, easing, attr) {
|
||||
animateFromAttr: function(attr, speed, easing) {
|
||||
var s = speed !== undefined ? speed : this.get('animationSpeed');
|
||||
var e = easing || this.get('animationEasing');
|
||||
|
||||
|
@ -422,10 +422,10 @@ var VisNode = Backbone.Model.extend({
|
|||
|
||||
animateUpdatedPosition: function(speed, easing) {
|
||||
var attr = this.getAttributes();
|
||||
this.animateFromAttr(speed, easing, attr);
|
||||
this.animateFromAttr(attr, speed, easing);
|
||||
},
|
||||
|
||||
animateFromAttr: function(speed, easing, attr) {
|
||||
animateFromAttr: function(attr, speed, easing) {
|
||||
this.get('circle').stop().animate(
|
||||
attr.circle,
|
||||
speed !== undefined ? speed : this.get('animationSpeed'),
|
||||
|
@ -469,6 +469,13 @@ var VisNode = Backbone.Model.extend({
|
|||
}, this);
|
||||
},
|
||||
|
||||
animateOutgoingEdgesFromSnapshot: function(snapshot, speed, easing) {
|
||||
_.each(this.get('outgoingEdges'), function(edge) {
|
||||
var attr = snapshot[edge.getID()];
|
||||
edge.animateFromAttr(attr, speed, easing);
|
||||
}, this);
|
||||
},
|
||||
|
||||
setOutgoingEdgesBirthPosition: function() {
|
||||
var parentCoords = this.getParentScreenCoords();
|
||||
_.each(this.get('outgoingEdges'), function(edge) {
|
||||
|
@ -611,10 +618,10 @@ var VisEdge = Backbone.Model.extend({
|
|||
|
||||
animateUpdatedPath: function(speed, easing) {
|
||||
var attr = this.getAttributes();
|
||||
this.animateFromAttributes(speed, easing, attr);
|
||||
this.animateFromAttr(attr, speed, easing);
|
||||
},
|
||||
|
||||
animateFromAttributes: function(speed, easing, attr) {
|
||||
animateFromAttr: function(attr, speed, easing) {
|
||||
this.get('path').toBack();
|
||||
this.get('path').stop().animate(
|
||||
attr.path,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue