Skip to content

Commit

Permalink
change PR to only use a single property for the 2nd output
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Conway-Jones committed Feb 15, 2020
1 parent 88e7296 commit 127b361
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
op2type: {value:"val"},
duration: {value:"250",required:true,validate:RED.validators.number()},
extend: {value:"false"},
second: {value:false},
units: {value:"ms"},
reset: {value:""},
bytopic: {value:"all"},
Expand Down Expand Up @@ -123,6 +122,9 @@
$("#node-stream-topic").show();
}
});

if (this.outputs == 2) { $("#node-input-second").prop('checked', true) }
else { $("#node-input-second").prop('checked', false) }

$("#node-input-second").change(function() {
if ($("#node-input-second").is(":checked")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function(RED) {
this.op2 = n.op2 || "0";
this.op1type = n.op1type || "str";
this.op2type = n.op2type || "str";
this.second = n.second || false;
this.second = (n.outputs == 2) ? true : false;
this.topic = n.topic || "topic";

if (this.op1type === 'val') {
Expand Down
2 changes: 1 addition & 1 deletion test/nodes/core/function/89-trigger_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ describe('trigger node', function() {
});

it('should be able to send 2nd message to a 2nd output', function(done) {
var flow = [{"id":"n1", "type":"trigger", "name":"triggerNode", op1type:"val", op2type:"val", op1:"hello", op2:"world", duration:"50", second:true, wires:[["n2"],["n3"]] },
var flow = [{"id":"n1", "type":"trigger", "name":"triggerNode", op1type:"val", op2type:"val", op1:"hello", op2:"world", duration:"50", outputs:2, wires:[["n2"],["n3"]] },
{id:"n2", type:"helper"}, {id:"n3", type:"helper"} ];
helper.load(triggerNode, flow, function() {
var n1 = helper.getNode("n1");
Expand Down

0 comments on commit 127b361

Please sign in to comment.