Merge pull request #5089 from atm-maxime/fix_slect_ziptown

Fix country and state were not properly updated after ziptown selection
This commit is contained in:
Laurent Destailleur 2016-04-29 19:26:40 +02:00
commit 5d1dbdb82c

View File

@ -291,14 +291,15 @@ function ajax_multiautocompleter($htmlname, $fields, $url, $option='', $minLengt
needtotrigger="#" + fields[i]; needtotrigger="#" + fields[i];
} }
} }
}
if (needtotrigger != "") // To force select2 to refresh visible content if (needtotrigger != "") // To force select2 to refresh visible content
{ {
// We introduce a delay so hand is back to js and all other js change can be done before the trigger that may execute a submit is done // We introduce a delay so hand is back to js and all other js change can be done before the trigger that may execute a submit is done
// This is required for example when changing zip with autocomplete that change the country // This is required for example when changing zip with autocomplete that change the country
jQuery(needtotrigger).delay(500).queue(function() { jQuery(needtotrigger).delay(500).queue(function() {
jQuery(needtotrigger).trigger("change"); jQuery(this).trigger("change");
}); });
}
} }
} }
}); });