Merge pull request #5864 from hregis/4.0_bug

Fix: add possibility to change width type to prevent some display issues
This commit is contained in:
Laurent Destailleur 2016-11-11 14:55:28 +01:00 committed by GitHub
commit fd1c0f404c

View File

@ -358,7 +358,7 @@ function ajax_dialog($title,$message,$w=350,$h=150)
* @param int $forcefocus Force focus on field
* @return string Return html string to convert a select field into a combo, or '' if feature has been disabled for some reason.
*/
function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0)
function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve')
{
global $conf;
@ -375,7 +375,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $
$(document).ready(function () {
$(\''.(preg_match('/^\./',$htmlname)?$htmlname:'#'.$htmlname).'\').'.$tmpplugin.'({
dir: \'ltr\',
width: \'resolve\', /* off or resolve */
width: \''.$widthTypeOfAutocomplete.'\', /* off or resolve */
minimumInputLength: '.$minLengthToAutocomplete.'
})';
if ($forcefocus) $msg.= '.select2(\'focus\')';