Skip to content

Commit

Permalink
ensure selecetd is sent if 0 (falsey) is chosen option
Browse files Browse the repository at this point in the history
to close node-red#43
  • Loading branch information
Dave Conway-Jones committed Oct 2, 2020
1 parent 6240c5a commit d9daa0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion node-red-node-ui-list/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-node-ui-list",
"version": "0.3.1",
"version": "0.3.2",
"description": "Node-RED Dashboard UI widget node for simple list",
"author": "Hiroyasu Nishiyama",
"contributors": [
Expand Down
8 changes: 4 additions & 4 deletions node-red-node-ui-list/ui_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ ${(allowMenu ? md_menu : "")}
// node-red-dashboard module.
ui = RED.require("node-red-dashboard")(RED);
}
config.tcol = ui.getTheme()["group-textColor"].value;
config.tcol = ui.getTheme()["group-textColor"].value || "#1bbfff";
// Initialize node
RED.nodes.createNode(this, config);
var done = null;
Expand Down Expand Up @@ -161,16 +161,16 @@ ${(allowMenu ? md_menu : "")}
return { msg: { items: value } };
},
beforeSend: function (msg, orig) {
if (orig) {
if (orig) {
orig.msg.topic = config.topic;
return orig.msg;
return orig.msg;
}
},
initController: function($scope, events) {
// initialize $scope.click to send clicked widget item
// used as ng-click="click(item, selected)"
$scope.click = function(item, selected) {
if (selected) { item.selected = selected; }
if (selected !== undefined) { item.selected = selected; }
if (item.hasOwnProperty("$$hashKey")) { delete item.$$hashKey; }
$scope.send({payload:item});
};
Expand Down

0 comments on commit d9daa0b

Please sign in to comment.