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");
msg.onmouseover = function() {
msg.style.borderRightColor = "#999";
RED.nodes.eachNode(function(node) {
if( node.id == o.id) {
node.highlighted = true;
node.dirty = true;
var n = RED.nodes.node(o.id);
if (n) {
n.highlighted = true;
n.dirty = true;
}
});
RED.view.redraw();
};
msg.onmouseout = function() {
msg.style.borderRightColor = "";
RED.nodes.eachNode(function(node) {
if( node.id == o.id) {
node.highlighted = false;
node.dirty = true;
var n = RED.nodes.node(o.id);
if (n) {
n.highlighted = false;
n.dirty = true;
}
});
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 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;");