diff --git a/src/animationFactory.js b/src/animationFactory.js index 01ffea1d..0c47fe94 100644 --- a/src/animationFactory.js +++ b/src/animationFactory.js @@ -109,8 +109,13 @@ AnimationFactory.prototype.rebaseHighlightPart = function(animationQueue, rebase var slowTime = fullTime * 2.0; // we want to highlight all the old commits - var oldCommits = rebaseResponse.toRebaseArray;//.reverse(); + var oldCommits = rebaseResponse.toRebaseArray; + // we are either highlighting to a visBranch or a visNode var visBranch = rebaseResponse.destinationBranch.get('visBranch'); + if (!visBranch) { + // in the case where we rebase onto a commit + visBranch = rebaseResponse.destinationBranch.get('visNode'); + } _.each(oldCommits, function(oldCommit) { var visNode = oldCommit.get('visNode'); diff --git a/src/git.js b/src/git.js index a00f781f..590e82b6 100644 --- a/src/git.js +++ b/src/git.js @@ -736,11 +736,12 @@ GitEngine.prototype.rebaseStarter = function() { GitEngine.prototype.rebase = function(targetSource, currentLocation) { var targetObj = this.resolveID(targetSource); + /* if (targetObj.get('type') !== 'branch') { throw new GitError({ msg: 'Only rebase onto branches! Not individual commits' }); - } + }*/ // first some conditions if (this.isUpstreamOf(targetSource, currentLocation)) { diff --git a/src/tree.js b/src/tree.js index 6f9cb7a1..710696a1 100644 --- a/src/tree.js +++ b/src/tree.js @@ -42,6 +42,10 @@ var VisBranch = VisBase.extend({ } }, + getFill: function() { + return this.get('fill'); + }, + getID: function() { return this.get('branch').get('id'); }, @@ -505,9 +509,9 @@ var VisNode = VisBase.extend({ }; }, - highlightTo: function(branch, speed, easing) { + highlightTo: function(visObj, speed, easing) { // a small function to highlight the color of a node for demonstration purposes - var color = branch.get('fill'); + var color = visObj.get('fill'); var attr = { circle: {