Fix css for multiselect component that are fist hidden

This commit is contained in:
Laurent Destailleur 2021-01-18 11:05:02 +01:00
parent 267caf7ac8
commit c69631d646
4 changed files with 12 additions and 8 deletions

View File

@ -6720,7 +6720,7 @@ class Form
// Add code for jquery to use multiselect // Add code for jquery to use multiselect
if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
{ {
$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.' --> $out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->
<script>'."\n"; <script>'."\n";
if ($addjscombo == 1) if ($addjscombo == 1)
{ {
@ -6751,6 +6751,10 @@ class Form
formatSelection: formatSelection, formatSelection: formatSelection,
templateSelection: formatSelection /* For 4.0 */ templateSelection: formatSelection /* For 4.0 */
}); });
/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set
the size only if component is not hidden by default on load */
$(\'#'.$htmlname.' + .select2\').addClass(\''.$morecss.'\');
});'."\n"; });'."\n";
} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) } elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT'))
{ {

View File

@ -1304,11 +1304,11 @@ table[summary="list_of_modules"] .fa-cog {
.minwidth500imp { min-width: 250px !important; } .minwidth500imp { min-width: 250px !important; }
} }
select.widthcentpercentminusx, input.widthcentpercentminusx { select.widthcentpercentminusx, span.widthcentpercentminusx, input.widthcentpercentminusx {
width: calc(100% - 52px) !important; width: calc(100% - 52px) !important;
display: inline-block; display: inline-block;
} }
select.widthcentpercentminusxx, input.widthcentpercentminusxx { select.widthcentpercentminusxx, span.widthcentpercentminusxx, input.widthcentpercentminusxx {
width: calc(100% - 70px) !important; width: calc(100% - 70px) !important;
display: inline-block; display: inline-block;
} }

View File

@ -1295,7 +1295,7 @@ table[summary="list_of_modules"] .fa-cog {
.minwidth500imp { min-width: 250px !important; } .minwidth500imp { min-width: 250px !important; }
} }
/* Set a width. Note: add also a max-width that will be used in priority */ /* Set a width. Note: add also a max-width, for example maxwidth500, that will be used in priority */
.widthcentpercentminusx { .widthcentpercentminusx {
width: calc(100% - 50px) !important; width: calc(100% - 50px) !important;
display: inline-block; display: inline-block;
@ -1335,7 +1335,7 @@ table[summary="list_of_modules"] .fa-cog {
padding-left: 0; padding-left: 0;
} }
.login_table input#username, .login_table input#password, .login_table input#securitycode { .login_table input#username, .login_table input#password, .login_table input#securitycode {
margin-left: 5px !important; margin-left: 5px !important;
} }
div#login_left, div#login_right { div#login_left, div#login_right {
min-width: 150px !important; min-width: 150px !important;
@ -2383,7 +2383,7 @@ form#login {
border-radius: 2px; border-radius: 2px;
} }
.login_table .tdinputlogin { .login_table .tdinputlogin {
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
} }
.login_table .tdinputlogin .fa { .login_table .tdinputlogin .fa {
padding-left: 10px; padding-left: 10px;

View File

@ -3628,11 +3628,11 @@ if ($action == 'editmeta' || $action == 'createcontainer') // Edit properties of
print '<tr><td class="toptd">'.$form->editfieldkey('Categories', 'categories', '', $objectpage, 0).'</td><td>'; print '<tr><td class="toptd">'.$form->editfieldkey('Categories', 'categories', '', $objectpage, 0).'</td><td>';
print img_picto('', 'category', 'class="paddingright"'); print img_picto('', 'category', 'class="paddingright"');
print $form->multiselectarray('categories', $cate_arbo, (GETPOSTISSET('categories') ? GETPOST('categories', 'array') : $arrayselected), null, null, 'quatrevingtpercent widthcentpercentminusx'); print $form->multiselectarray('categories', $cate_arbo, (GETPOSTISSET('categories') ? GETPOST('categories', 'array') : $arrayselected), null, null, 'minwidth200 widthcentpercentminusxx');
print "</td></tr>"; print "</td></tr>";
} }
if (!empty($conf->global->WEBSITE_PAGE_SHOW_INTERNAL_LINKS_TO_OBJECT)) { if (!empty($conf->global->WEBSITE_PAGE_SHOW_INTERNAL_LINKS_TO_OBJECT)) { // TODO Replace this with link into element_element ?
print '<tr><td class="titlefieldcreate">'; print '<tr><td class="titlefieldcreate">';
print 'ObjectClass'; print 'ObjectClass';
print '</td><td>'; print '</td><td>';