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

Fix trigger extend behaviour

This commit is contained in:
Nick O'Leary 2015-06-25 13:59:26 -07:00
parent 6c8b7c0082
commit 06731374a4

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2014 IBM Corp. * Copyright 2014, 2015 IBM Corp.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -23,7 +23,9 @@ module.exports = function(RED) {
this.op2 = n.op2 || "0"; this.op2 = n.op2 || "0";
this.op1type = n.op1type || "val"; this.op1type = n.op1type || "val";
this.op2type = n.op2type || "val"; this.op2type = n.op2type || "val";
console.log(n.extend,typeof n.extend);
this.extend = n.extend || "false"; this.extend = n.extend || "false";
console.log(this.extend);
this.units = n.units || "ms"; this.units = n.units || "ms";
this.duration = n.duration || 250; this.duration = n.duration || 250;
if (this.duration <= 0) { this.duration = 0; } if (this.duration <= 0) { this.duration = 0; }
@ -73,7 +75,7 @@ module.exports = function(RED) {
},node.duration); },node.duration);
} }
} }
else if ((node.extend == "true") && (node.duration > 0)) { else if ((node.extend === "true" || node.extend === true) && (node.duration > 0)) {
clearTimeout(tout); clearTimeout(tout);
tout = setTimeout(function() { tout = setTimeout(function() {
msg.payload = m2; msg.payload = m2;