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

Merge pull request #370 from jhr007/patch-2

Add checkbox support so config dialogs can save checkbox values
This commit is contained in:
Nick O'Leary 2014-09-01 20:31:17 +01:00
commit 16048112c6

View File

@ -587,7 +587,12 @@ RED.editor = (function() {
configNode = RED.nodes.node(configId); configNode = RED.nodes.node(configId);
for (d in configTypeDef.defaults) { for (d in configTypeDef.defaults) {
if (configTypeDef.defaults.hasOwnProperty(d)) { if (configTypeDef.defaults.hasOwnProperty(d)) {
configNode[d] = $("#node-config-input-"+d).val(); var input = $("#node-config-input-"+d);
if (input.attr('type') === "checkbox") {
configNode[d] = input.prop('checked');
} else {
configNode[d] = input.val();
}
} }
} }
updateConfigNodeSelect(configProperty,configType,configId); updateConfigNodeSelect(configProperty,configType,configId);