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

hide delay node reset label on deploy

to close #2145
This commit is contained in:
Dave Conway-Jones 2019-04-21 10:31:36 +01:00
parent ed2a45e975
commit 4588089bd6
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4

View File

@ -88,10 +88,11 @@ module.exports = function(RED) {
};
}
var clearDelayList = function() {
var clearDelayList = function(s) {
for (var i=0; i<node.idList.length; i++ ) { node.idList[i].clear(); }
node.idList = [];
node.status({text:"reset"});
if (s) { node.status({text:"reset"}); }
else { node.status({}); }
}
var flushDelayList = function() {
@ -124,7 +125,7 @@ module.exports = function(RED) {
if ((node.timeout > 1000) && (node.idList.length !== 0)) {
node.status({fill:"blue",shape:"dot",text:" "});
}
if (msg.hasOwnProperty("reset")) { clearDelayList(); }
if (msg.hasOwnProperty("reset")) { clearDelayList(true); }
}
});
node.on("close", function() { clearDelayList(); });
@ -145,7 +146,7 @@ module.exports = function(RED) {
if ((delayvar >= 0) && (node.idList.length !== 0)) {
node.status({fill:"blue",shape:"dot",text:delayvar/1000+"s"});
}
if (msg.hasOwnProperty("reset")) { clearDelayList(); }
if (msg.hasOwnProperty("reset")) { clearDelayList(true); }
if (msg.hasOwnProperty("flush")) { flushDelayList(); }
});
node.on("close", function() { clearDelayList(); });
@ -267,7 +268,7 @@ module.exports = function(RED) {
if ((node.timeout >= 1000) && (node.idList.length !== 0)) {
node.status({fill:"blue",shape:"dot",text:parseInt(wait/10)/100+"s"});
}
if (msg.hasOwnProperty("reset")) { clearDelayList(); }
if (msg.hasOwnProperty("reset")) { clearDelayList(true); }
if (msg.hasOwnProperty("flush")) { flushDelayList(); }
});
node.on("close", function() { clearDelayList(); });