backoffice: disable "simple list" choice for map/timetable selections (#50035)

This commit is contained in:
Frédéric Péters 2021-01-11 14:15:01 +01:00
parent 65c3293e98
commit 3cac5c56ff
1 changed files with 3 additions and 0 deletions

View File

@ -258,8 +258,10 @@ $(function() {
$('[type=radio][name=display_mode]').on('change', function() {
// show everything
$('select[name="data_source$type"] option').show();
$('input[name="data_mode"][value="simple-list"]').prop('disabled', false);
// then restrict
if ($(this).val() == 'map') {
$('input[name="data_mode"][value="simple-list"]').prop('disabled', true);
$('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) {
@ -267,6 +269,7 @@ $(function() {
}
}
if ($(this).val() == 'timetable') {
$('input[name="data_mode"][value="simple-list"]').prop('disabled', true);
$('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) {