Projet

Général

Profil

0003-backoffice-disable-simple-list-choice-for-map-dateti.patch

Frédéric Péters, 11 janvier 2021 20:58

Télécharger (1,64 ko)

Voir les différences:

Subject: [PATCH 3/4] backoffice: disable "simple list" choice for
 map/datetimes selections (#50035)

 wcs/qommon/static/js/qommon.admin.js | 3 +++
 1 file changed, 3 insertions(+)
wcs/qommon/static/js/qommon.admin.js
258 258
    $('[type=radio][name=display_mode]').on('change', function() {
259 259
      // show everything
260 260
      $('select[name="data_source$type"] option').show();
261
      $('input[name="data_mode"][value="simple-list"]').prop('disabled', false);
261 262
      // then restrict
262 263
      if ($(this).val() == 'map') {
264
        $('input[name="data_mode"][value="simple-list"]').prop('disabled', true);
263 265
        $('input[name="data_mode"][value="data-source"]').click()
264 266
        $('select[name="data_source$type"] option:not([data-type="geojson"])').hide();
265 267
        if ($('select[name="data_source$type"] option:selected:visible').length == 0) {
......
267 269
        }
268 270
      }
269 271
      if ($(this).val() == 'datetimes') {
272
        $('input[name="data_mode"][value="simple-list"]').prop('disabled', true);
270 273
        $('input[name="data_mode"][value="data-source"]').click()
271 274
        $('select[name="data_source$type"] option:not([data-maybe-datetimes="true"])').hide();
272 275
        if ($('select[name="data_source$type"] option:selected:visible').length == 0) {
273
-