From 417daa4289c2545bf7a254ff5bbd4f186a9e002b Mon Sep 17 00:00:00 2001 From: atm-florian Date: Wed, 20 Oct 2021 11:15:02 +0200 Subject: [PATCH 1/3] FIX 14.0 - civility field width inadequate due to select2 calculating the width while the field has no width (display: none) --- htdocs/societe/card.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index bfee51e5f8d..e283333070b 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1151,6 +1151,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $("#typent_id").change(); $("#effectif_id").val(id_ef15); $("#effectif_id").change(); + if ($("#civility_id").data("select2")) { + $("#civility_id").select2({width: "resolve"}); + } $("#TypeName").html(document.formsoc.LastName.value); document.formsoc.private.value=1; }); From f59f605bcc9dad53ba821a71c1165b4773eadfee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 11:29:34 +0200 Subject: [PATCH 2/3] Update card.php --- htdocs/societe/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index e283333070b..c228fd29866 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1151,6 +1151,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $("#typent_id").change(); $("#effectif_id").val(id_ef15); $("#effectif_id").change(); + /* Force recompute width of a select2 field when it was hidden and then shown */ if ($("#civility_id").data("select2")) { $("#civility_id").select2({width: "resolve"}); } From ae1da432250d521728e575da33153670fb0afec7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 11:30:38 +0200 Subject: [PATCH 3/3] Update card.php --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index c228fd29866..5c9c0f63e94 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1151,7 +1151,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $("#typent_id").change(); $("#effectif_id").val(id_ef15); $("#effectif_id").change(); - /* Force recompute width of a select2 field when it was hidden and then shown */ + /* Force to recompute the width of a select2 field when it was hidden and then shown programatically */ if ($("#civility_id").data("select2")) { $("#civility_id").select2({width: "resolve"}); }