mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 10:21:32 +01:00
Fix: use keyup instead change to avoid loosing the product id
Fix: strict mode
This commit is contained in:
@@ -48,8 +48,9 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
|
||||
var options = '.json_encode($ajaxoptions).';
|
||||
|
||||
// Remove product id before select another product
|
||||
$("input#search_'.$htmlname.'").change(function() {
|
||||
$("#'.$htmlname.'").val("").trigger("change");
|
||||
// use keyup instead change to avoid loosing the product id
|
||||
$("input#search_'.$htmlname.'").keyup(function() {
|
||||
$("#'.$htmlname.'").val("").trigger("change");
|
||||
});
|
||||
// Check when keyup
|
||||
$("input#search_'.$htmlname.'").onDelayedKeyup({ handler: function() {
|
||||
@@ -163,7 +164,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
|
||||
}).data( "autocomplete" )._renderItem = function( ul, item ) {
|
||||
return $( "<li></li>" )
|
||||
.data( "item.autocomplete", item )
|
||||
.append( \'<a href="#"><span class="tag">\' + item.label + "</span></a>" )
|
||||
.append( \'<a><span class="tag">\' + item.label + "</span></a>" )
|
||||
.appendTo(ul);
|
||||
};
|
||||
});';
|
||||
|
||||
Reference in New Issue
Block a user