fields: update data source fields on change of display mode (#50035)

This commit is contained in:
Frédéric Péters 2021-01-11 14:04:17 +01:00
parent 78ebedfdcd
commit 65c3293e98
1 changed files with 2 additions and 2 deletions

View File

@ -263,14 +263,14 @@ $(function() {
$('input[name="data_mode"][value="data-source"]').click()
$('select[name="data_source$type"] option:not([data-type="geojson"])').hide();
if ($('select[name="data_source$type"] option:selected:visible').length == 0) {
$('select[name="data_source$type"] option:visible').first().prop('selected', true);
$('select[name="data_source$type"] option:visible').first().prop('selected', true).trigger('change');
}
}
if ($(this).val() == 'timetable') {
$('input[name="data_mode"][value="data-source"]').click()
$('select[name="data_source$type"] option:not([data-maybe-datetimes="true"])').hide();
if ($('select[name="data_source$type"] option:selected:visible').length == 0) {
$('select[name="data_source$type"] option:visible').first().prop('selected', true);
$('select[name="data_source$type"] option:visible').first().prop('selected', true).trigger('change');
}
}
});