Skip to content

Commit

Permalink
Merge pull request #178 from flowforge/129-dropdown-passthru
Browse files Browse the repository at this point in the history
Add passthrough option for Dropdown (off by default)
  • Loading branch information
joepavitt authored Sep 7, 2023
2 parents f8f7690 + b24e2ed commit 809ba53
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions nodes/widgets/ui_dropdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
height: { value: 0 },
passthru: { value: true },
passthru: { value: false },
multiple: { value: false },
options: {
value: [{ value: '', label: '' }],
Expand Down Expand Up @@ -187,10 +187,10 @@
<label style="width:auto" for="node-input-multiple"><i class="fa fa-th-list"></i> Allow multiple selections from list: </label>
<input type="checkbox" checked id="node-input-multiple" style="display: inline-block; width: auto; margin: 0px 0px 0px 4px;">
</div>
<!--<div class="form-row">
<div class="form-row">
<label style="width:auto" for="node-input-passthru"><i class="fa fa-arrow-right"></i> If <code>msg</code> arrives on input, pass through to output: </label>
<input type="checkbox" checked id="node-input-passthru" style="display:inline-block; width:auto; vertical-align:top;">
</div>-->
</div>
<div class="form-row">
<label for="node-input-topic"><i class="fa fa-tasks"></i> Topic</label>
<input type="text" id="node-input-topic" style="width:70%" placeholder="optional msg.topic">
Expand Down
7 changes: 6 additions & 1 deletion nodes/widgets/ui_dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ module.exports = function (RED) {
const group = RED.nodes.getNode(config.group)

const evts = {
onChange: true
onChange: true,
onInput: function (msg, send) {
if (config.passthru) {
send(msg)
}
}
}

// inform the dashboard UI that we are adding this node
Expand Down

0 comments on commit 809ba53

Please sign in to comment.