Fixed that autocomplete results are not reset after clearing search field (#11909).
Contributed by Jongwook Choi. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10527 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
81782f2408
commit
8cf8f5bdbf
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue