From 48a51e60bc20eabb6f563118a4eda82ea6e409c0 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 26 Dec 2012 12:01:11 +0000 Subject: [PATCH] Adds an indicator to all autocomplete/search fields. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11082 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- public/javascripts/application.js | 6 +++++- public/stylesheets/application.css | 11 ++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 3284c6a86..9fa0e9b9e 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -460,14 +460,18 @@ function observeAutocompleteField(fieldId, url, options) { $(document).ready(function() { $('#'+fieldId).autocomplete($.extend({ source: url, - minLength: 2 + minLength: 2, + search: function(){$('#'+fieldId).addClass('ajax-loading');}, + response: function(){$('#'+fieldId).removeClass('ajax-loading');}, }, options)); + $('#'+fieldId).addClass('autocomplete'); }); } function observeSearchfield(fieldId, targetId, url) { $('#'+fieldId).each(function() { var $this = $(this); + $this.addClass('autocomplete'); $this.attr('data-value-was', $this.val()); var check = function() { var val = $this.val(); diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 97d26817f..1e17c1284 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -569,12 +569,13 @@ div#tab-content-members fieldset div, div#tab-content-users fieldset div { max-h table.members td.group { padding-left: 20px; background: url(../images/group.png) no-repeat 0% 50%; } -input#principal_search, input#user_search {width:100%} -input#principal_search, input#user_search { - background: url(../images/magnifier.png) no-repeat 2px 50%; padding-left:20px; - border:1px solid #9EB1C2; border-radius:3px; height:1.5em; width:95%; +input#principal_search, input#user_search {width:90%} + +input.autocomplete { + background: #fff url(../images/magnifier.png) no-repeat 2px 50%; padding-left:20px; + border:1px solid #9EB1C2; border-radius:2px; height:1.5em; } -input#principal_search.ajax-loading, input#user_search.ajax-loading { +input.autocomplete.ajax-loading { background-image: url(../images/loading.gif); }