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

Merge pull request #2090 from node-red-hitachi/fix-file-node-encoding-menu

Fix problem on displaying option label on Firefox
This commit is contained in:
Nick O'Leary 2019-03-13 10:46:23 +00:00 committed by GitHub
commit faae184f1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,10 +219,11 @@
oneditprepare: function() { oneditprepare: function() {
var node = this; var node = this;
var encSel = $("#node-input-encoding"); var encSel = $("#node-input-encoding");
var label = node._("file.encoding.none");
$("<option/>", { $("<option/>", {
value: "none", value: "none",
label: node._("file.encoding.none") label: label
}).appendTo(encSel); }).text(label).appendTo(encSel);
encodings.forEach(function(item) { encodings.forEach(function(item) {
if(Array.isArray(item)) { if(Array.isArray(item)) {
var group = $("<optgroup/>", { var group = $("<optgroup/>", {
@ -233,14 +234,14 @@
$("<option/>", { $("<option/>", {
value: enc, value: enc,
label: enc label: enc
}).appendTo(group); }).text(enc).appendTo(group);
} }
} }
else { else {
$("<option/>", { $("<option/>", {
value: item, value: item,
label: item label: item
}).appendTo(encSel); }).text(item).appendTo(encSel);
} }
}); });
encSel.val(node.encoding); encSel.val(node.encoding);
@ -277,10 +278,11 @@
oneditprepare: function() { oneditprepare: function() {
var node = this; var node = this;
var encSel = $("#node-input-encoding"); var encSel = $("#node-input-encoding");
var label = node._("file.encoding.none");
$("<option/>", { $("<option/>", {
value: "none", value: "none",
label: node._("file.encoding.none") label: label
}).appendTo(encSel); }).text(label).appendTo(encSel);
encodings.forEach(function(item) { encodings.forEach(function(item) {
if(Array.isArray(item)) { if(Array.isArray(item)) {
var group = $("<optgroup/>", { var group = $("<optgroup/>", {
@ -291,14 +293,14 @@
$("<option/>", { $("<option/>", {
value: enc, value: enc,
label: enc label: enc
}).appendTo(group); }).text(enc).appendTo(group);
} }
} }
else { else {
$("<option/>", { $("<option/>", {
value: item, value: item,
label: item label: item
}).appendTo(encSel); }).text(item).appendTo(encSel);
} }
}); });
encSel.val(node.encoding); encSel.val(node.encoding);