1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Single-click on debug message reveals node

Closes #192
This commit is contained in:
Nick O'Leary 2014-04-16 12:59:23 +01:00
parent a386c028b0
commit 4219681cfa

View File

@ -138,24 +138,29 @@
var msg = document.createElement("div"); var msg = document.createElement("div");
msg.onmouseover = function() { msg.onmouseover = function() {
msg.style.borderRightColor = "#999"; msg.style.borderRightColor = "#999";
RED.nodes.eachNode(function(node) { var n = RED.nodes.node(o.id);
if( node.id == o.id) { if (n) {
node.highlighted = true; n.highlighted = true;
node.dirty = true; n.dirty = true;
} }
});
RED.view.redraw(); RED.view.redraw();
}; };
msg.onmouseout = function() { msg.onmouseout = function() {
msg.style.borderRightColor = ""; msg.style.borderRightColor = "";
RED.nodes.eachNode(function(node) { var n = RED.nodes.node(o.id);
if( node.id == o.id) { if (n) {
node.highlighted = false; n.highlighted = false;
node.dirty = true; n.dirty = true;
} }
});
RED.view.redraw(); RED.view.redraw();
}; };
msg.onclick = function() {
var node = RED.nodes.node(o.id);
if (node) {
RED.view.showWorkspace(node.z);
}
};
var name = (o.name?o.name:o.id).toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"); var name = (o.name?o.name:o.id).toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
var topic = (o.topic||"").toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"); var topic = (o.topic||"").toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
var payload = (o.msg||"").toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"); var payload = (o.msg||"").toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");