Fix: add possibility to change width type to prevent some display issues
This commit is contained in:
parent
24420edd46
commit
d848e98759
@ -366,6 +366,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $
|
|||||||
if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return '';
|
if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return '';
|
||||||
if (empty($conf->use_javascript_ajax)) return '';
|
if (empty($conf->use_javascript_ajax)) return '';
|
||||||
|
|
||||||
|
$widthTypeOfAutocomplete = (!empty($conf->global->MAIN_WIDTH_TYPE_OF_AUTOCOMPLETE) ? $conf->global->MAIN_WIDTH_TYPE_OF_AUTOCOMPLETE : 'resolve');
|
||||||
if (empty($minLengthToAutocomplete)) $minLengthToAutocomplete=0;
|
if (empty($minLengthToAutocomplete)) $minLengthToAutocomplete=0;
|
||||||
|
|
||||||
$tmpplugin='select2';
|
$tmpplugin='select2';
|
||||||
@ -374,7 +375,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $
|
|||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$(\''.(preg_match('/^\./',$htmlname)?$htmlname:'#'.$htmlname).'\').'.$tmpplugin.'({
|
$(\''.(preg_match('/^\./',$htmlname)?$htmlname:'#'.$htmlname).'\').'.$tmpplugin.'({
|
||||||
dir: \'ltr\',
|
dir: \'ltr\',
|
||||||
width: \'resolve\', /* off or resolve */
|
width: \''.$widthTypeOfAutocomplete.'\', /* off or resolve */
|
||||||
minimumInputLength: '.$minLengthToAutocomplete.'
|
minimumInputLength: '.$minLengthToAutocomplete.'
|
||||||
})';
|
})';
|
||||||
if ($forcefocus) $msg.= '.select2(\'focus\')';
|
if ($forcefocus) $msg.= '.select2(\'focus\')';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user