Make status display toggleable and add to MQTT nodes

This commit is contained in:
Nick O'Leary
2014-05-10 23:33:02 +01:00
parent ec5985eaa3
commit 7e85eb297d
4 changed files with 47 additions and 7 deletions

View File

@@ -161,13 +161,24 @@ var RED = function() {
var node = RED.nodes.node(parts[1]);
if (node) {
node.status = msg;
node.dirty = true;
RED.view.redraw();
if (statusEnabled) {
node.dirty = true;
RED.view.redraw();
}
}
});
});
}
$('#btn-node-status').click(function() {toggleStatus();});
var statusEnabled = false;
function toggleStatus() {
var btnStatus = $("#btn-node-status");
statusEnabled = btnStatus.toggleClass("active").hasClass("active");
RED.view.status(statusEnabled);
}
function showHelp() {
var dialog = $('#node-help');