big finish on the rebase animation

This commit is contained in:
Peter Cottle 2012-09-30 16:30:43 -07:00
parent b106e22ac3
commit 311e429ba3
4 changed files with 59 additions and 49 deletions

View file

@ -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,