Projet

Général

Profil

0001-misc-limit-checkbox-js-prefill-to-single-checkbox-fi.patch

Frédéric Péters, 05 novembre 2021 14:53

Télécharger (1,35 ko)

Voir les différences:

Subject: [PATCH] misc: limit checkbox js prefill to single checkbox field
 (#58422)

 wcs/qommon/static/js/qommon.forms.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
wcs/qommon/static/js/qommon.forms.js
480 480
                if ($(widget).is('.widget-prefilled') || $(widget).is('.widget-readonly') || data.modified_field == 'user') {
481 481
                  // replace text input value
482 482
                  $(widget).find('input[type=text], input[type=tel], input[type=numeric], input[type=email], input[type=date], textarea').val(value.content);
483
                  // replace checkbox input value
484
                  $(widget).find('input[type=checkbox]').prop('checked', value.content);
483
                  if ($widget.hasClass('CheckboxWidget')) {
484
                    // replace checkbox input value
485
                    $widget.find('input[type=checkbox]').prop('checked', value.content);
486
                  }
485 487
                }
486 488
              }
487 489
            });
488
-