Refinements to Unknown-node handling

Refinement to #113
This commit is contained in:
Nick O'Leary
2013-12-12 15:51:15 +00:00
parent 4fff3ce448
commit 344660dfee
7 changed files with 67 additions and 30 deletions

View File

@@ -16,7 +16,7 @@
RED.notify = function() {
var currentNotifications = [];
var c = 0;
return function(msg,type,fixed) {
return function(msg,type,fixed,timeout) {
if (currentNotifications.length > 4) {
var ll = currentNotifications.length;
for (var i = 0;ll > 4 && i<currentNotifications.length;i+=1) {
@@ -49,7 +49,7 @@ RED.notify = function() {
};
}();
if (!fixed) {
n.timeoutid = window.setTimeout(n.close,3000);
n.timeoutid = window.setTimeout(n.close,timeout||3000);
}
currentNotifications.push(n);
c+=1;

View File

@@ -722,6 +722,7 @@ RED.view = function() {
var mainRect = node.append("rect")
.attr("class", "node")
.classed("node_unknown",function(d) { return d.type == "unknown"; })
.attr("rx", 6)
.attr("ry", 6)
.attr("fill",function(d) { return d._def.color;})
@@ -952,7 +953,8 @@ RED.view = function() {
})
link.classed("link_selected", function(d) { return d === selected_link || d.selected; });
link.classed("link_unknown",function(d) { return d.target.type == "unknown" || d.source.type == "unknown"});
if (d3.event) {
d3.event.preventDefault();
}