Commit afe3661f authored by jplang's avatar jplang
Browse files

Fixed that autocomplete results are not reset after clearing search field (#11909).

Contributed by Jongwook Choi.

git-svn-id: https://svn.redmine.org/redmine/trunk@10527 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent fb6cfee4
......@@ -496,16 +496,14 @@ function observeSearchfield(fieldId, targetId, url) {
var val = $this.val();
if ($this.attr('data-value-was') != val){
$this.attr('data-value-was', val);
if (val != '') {
$.ajax({
url: url,
type: 'get',
data: {q: $this.val()},
success: function(data){ $('#'+targetId).html(data); },
beforeSend: function(){ $this.addClass('ajax-loading'); },
complete: function(){ $this.removeClass('ajax-loading'); }
});
}
$.ajax({
url: url,
type: 'get',
data: {q: $this.val()},
success: function(data){ $('#'+targetId).html(data); },
beforeSend: function(){ $this.addClass('ajax-loading'); },
complete: function(){ $this.removeClass('ajax-loading'); }
});
}
};
var reset = function() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment