add a delay before a node get hidden again to get time to reach it with the cursor
--- a/client/js/renderer/noderepr.js Fri Sep 18 15:58:21 2015 +0200
+++ b/client/js/renderer/noderepr.js Fri Sep 18 15:59:44 2015 +0200
@@ -364,6 +364,7 @@
_editor.draw();
},
select: function() {
+ clearTimeout(this.hide_timeout);
this.selected = true;
this.circle.strokeWidth = this._getSelectedStrokeWidth();
if (this.renderer.isEditable() && !this.hidden) {
@@ -419,11 +420,17 @@
this.hide();
}
else {
- this.hideNeighbors();
+ this.hideNeighbors(true);
}
this._super("unselect");
}
},
+ hide_delay: function(){
+ var _this = this;
+ this.hide_timeout = setTimeout(function(){
+ _this.hide();
+ }, 1000);
+ },
hide: function(){
var _this = this;
this.ghost = false;
@@ -450,7 +457,7 @@
}
}
);
- this.hideNeighbors();
+ this.hideNeighbors(false);
},
show: function(ghost){
var _this = this;
@@ -482,7 +489,7 @@
}
);
},
- hideNeighbors: function(){
+ hideNeighbors: function(delay){
var _this = this;
_.each(
this.project.get("edges").filter(
@@ -493,7 +500,7 @@
function(edge, index, list) {
var repr = _this.renderer.getRepresentationByModel(edge.get("to"));
if (repr && repr.ghost) {
- repr.hide();
+ if (delay){ repr.hide_delay(); } else {repr.hide(); }
}
}
);