diff --git a/nodes/core/89-delay.js b/nodes/core/89-delay.js index 3a534c6c0..1a3bfbd43 100644 --- a/nodes/core/89-delay.js +++ b/nodes/core/89-delay.js @@ -18,31 +18,32 @@ // Require main module var RED = require("../../red/red"); -var idList = []; // main node definition function DelayNode(n) { RED.nodes.createNode(this,n); this.timeout = n.timeout * 1000; - this.name = n.name + this.name = n.name; + this.idList = []; this.on("input", function(msg) { var node= this; var id; id = setTimeout(function(){ - idList.splice(idList.indexOf(id),1); + node.idList.splice(node.idList.indexOf(id),1); node.send(msg); }, node.timeout); - idList.push(id); + this.idList.push(id); }); } // register node -RED.nodes.registerType("pause",DelayNode); +RED.nodes.registerType("delay",DelayNode); DelayNode.prototype.close = function() { - for (var i=0; i - -