git log now done, fixed up result rendering

This commit is contained in:
Peter Cottle 2012-09-22 21:16:59 -07:00
parent 543f5986ae
commit 9c7ec69e2f
10 changed files with 189 additions and 35 deletions

View file

@ -1,6 +1,9 @@
var VisBranch = Backbone.Model.extend({
defaults: {
pos: null
pos: null,
text: null,
animationSpeed: GRAPHICS.defaultAnimationTime,
animationEasing: GRAPHICS.defaultEasing
},
validateAtInit: function() {
@ -37,20 +40,14 @@ var VisBranch = Backbone.Model.extend({
this.set('text', text);
},
animateUpdatedPos: function(paper) {
animateUpdatedPos: function(speed, easing) {
var pos = this.getPosition();
var t = this.get('text');
if (!t) {
this.genGraphics(paper);
t = this.get('text');
// TODO HACKY
}
this.get('text').toFront().stop().animate({
x: pos.x,
y: pos.y
},
300,
'easeInOut'
speed || this.get('animationSpeed'),
easing || this.get('animationEasing')
);
}
});