mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-05 16:42:53 +01:00
Fix: ajout d'une tempo avant l'execution de autofilltownfromzip_save_refresh_* afin que les donnes se mettent en place en Ajax
This commit is contained in:
@@ -325,10 +325,22 @@ class Form
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$pays_id = $obj->rowid?$obj->rowid:'';
|
||||
|
||||
// On applique un delai d'execution pour le bon fonctionnement
|
||||
$mode = substr($htmloption,-9,6);
|
||||
if ($mode == 'create')
|
||||
{
|
||||
$htmloption = 'onChange="ac_delay(\'autofilltownfromzip_save_refresh_create()\',\'500\')"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$htmloption = 'onChange="ac_delay(\'autofilltownfromzip_save_refresh_edit()\',\'500\')"';
|
||||
}
|
||||
|
||||
print '<div>';
|
||||
print '<input type="text" size="45" id="pays" name="pays" value="'.$obj->libelle.'" />';
|
||||
print '<input type="text" size="45" id="pays" name="pays" value="'.$obj->libelle.'" '.$htmloption.' />';
|
||||
print '<span id="indicator1" style="display: none">'.img_gif('Working...','ajaxworking').'</span>';
|
||||
print '<input type="hidden" name="pays_id" id="pays_id" value="'.$pays_id.'" '.$htmloption.' />';
|
||||
print '<input type="hidden" name="pays_id" id="pays_id" value="'.$pays_id.'" />';
|
||||
print '</div>';
|
||||
print '<div id="hint" class="autocomplete"></div>';
|
||||
print '<script type="text/javascript">';
|
||||
|
||||
@@ -610,3 +610,14 @@ function ac_return(field, item){
|
||||
// et on l'affecte au champ cach<63>
|
||||
$(field.name+'_id').value = id;
|
||||
}
|
||||
|
||||
/*=================================================================
|
||||
Purpose: Applique un d<>lai avant execution
|
||||
Input: funct, delay
|
||||
Author: Regis Houssin
|
||||
Licence: GPL
|
||||
==================================================================*/
|
||||
function ac_delay(funct,delay) {
|
||||
// d<>lai exprim<69> en millisecondes avant le d<>clenchement de l'action
|
||||
setTimeout(funct,delay);
|
||||
}
|
||||
Reference in New Issue
Block a user