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

fix problem on displaying option label on Firefox

This commit is contained in:
Hiroyasu Nishiyama 2019-03-13 19:17:32 +09:00
parent 58914e5c5f
commit 515a8a9bbb

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);