Skip to content

Commit

Permalink
Adds an indicator to all autocomplete/search fields.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11082 e93f8b46-1217-0410-a6f0-8f06a7374b81
  • Loading branch information
jplang committed Dec 26, 2012
1 parent 7606353 commit 48a51e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 5 additions & 1 deletion public/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
11 changes: 6 additions & 5 deletions public/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 48a51e6

Please sign in to comment.