misc: limit dynamic first option label update to first empty choice (#86111) #1068
|
@ -86,9 +86,9 @@ $(function() {
|
|||
if ($widgets.length > 1) {
|
||||
var values = $widgets.find('select').map((idx, elt) => {return $(elt).val()}).toArray().slice(1)
|
||||
if (values.every(v => (v === ""))) { // all empty
|
||||
$widgets.find('select').first().find('option[value=""]').text($(this).attr('data-first-element-empty-label'));
|
||||
$widgets.find('select').first().find('option[value=""]').first().text($(this).attr('data-first-element-empty-label'));
|
||||
} else {
|
||||
$widgets.find('select').first().find('option[value=""]').text('---');
|
||||
$widgets.find('select').first().find('option[value=""]').first().text('---');
|
||||
}
|
||||
}
|
||||
}).trigger('change');
|
||||
|
|
Loading…
Reference in New Issue