summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-29 16:43:11 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-29 16:43:11 +0000
commit8cf8f5bdbfe0d7ab859ba7200d3b7fcb9ad0beba (patch)
tree68ed0972f4f1bebbc3c46f543ab596e0438d93ab /public
parent81782f2408b1a2421c8778deacb97ac61c963216 (diff)
downloadredmine-8cf8f5bdbfe0d7ab859ba7200d3b7fcb9ad0beba.tar.gz
redmine-8cf8f5bdbfe0d7ab859ba7200d3b7fcb9ad0beba.zip
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
Diffstat (limited to 'public')
-rw-r--r--public/javascripts/application.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 3f2b2392c..916a53709 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -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() {