Skip to content

Commit 95a7522

Browse files
committed
Concurrency flag checks for setroot
1 parent 786590c commit 95a7522

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Source/Visualizations/Spacetree.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,9 @@ $jit.ST= (function() {
475475
(end code)
476476
*/
477477
setRoot: function(id, method, onComplete) {
478-
var that = this, canvas = this.canvas;
478+
if(this.busy) return;
479+
this.busy = true;
480+
var that = this, canvas = this.canvas;
479481
var rootNode = this.graph.getNode(this.root);
480482
var clickedNode = this.graph.getNode(id);
481483
function $setRoot() {
@@ -513,9 +515,11 @@ $jit.ST= (function() {
513515
}
514516
});
515517
this.compute('end');
518+
this.busy = true;
516519
this.fx.animate({
517520
modes: ['linear', 'node-property:alpha'],
518521
onComplete: function() {
522+
that.busy = false;
519523
that.onClick(id, {
520524
onComplete: function() {
521525
onComplete && onComplete.onComplete();

0 commit comments

Comments
 (0)