Fix: best method

This commit is contained in:
Regis Houssin 2018-04-13 19:30:11 +02:00
parent 199bf4c044
commit 556a418132

View File

@ -386,11 +386,10 @@ function ajax_autoselect($htmlname, $addlink='')
* @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete * @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete
* @param int $forcefocus Force focus on field * @param int $forcefocus Force focus on field
* @param string $widthTypeOfAutocomplete 'resolve' or 'off' * @param string $widthTypeOfAutocomplete 'resolve' or 'off'
* @param string $modalid ID of modal (for avoid focus problem when select2 is in a modal dialog window)
* @return string Return html string to convert a select field into a combo, or '' if feature has been disabled for some reason. * @return string Return html string to convert a select field into a combo, or '' if feature has been disabled for some reason.
* @see selectArrayAjax of html.form.class * @see selectArrayAjax of html.form.class
*/ */
function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $modalid='dialog-confirm') function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve')
{ {
global $conf; global $conf;
@ -427,7 +426,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $
escapeMarkup: function(markup) { escapeMarkup: function(markup) {
return markup; return markup;
}, },
dropdownParent: $(\'#'.$modalid.'\') dropdownCssClass: \'ui-dialog\'
})'; })';
if ($forcefocus) $msg.= '.select2(\'focus\')'; if ($forcefocus) $msg.= '.select2(\'focus\')';
$msg.= ';'."\n"; $msg.= ';'."\n";