新建问题-主题-autocomplete-选中跳转
This commit is contained in:
parent
9b151567f1
commit
786481e144
|
@ -30,6 +30,7 @@ class AutoCompletesController < ApplicationController
|
|||
@issues.compact!
|
||||
end
|
||||
render :layout => false
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
<% if @issue.safe_attribute? 'tracker_id' %>
|
||||
<p><%= f.select :tracker_id, @issue.project.trackers.collect {|t| [t.name, t.id]}, {:required => true},
|
||||
:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')" %></p>
|
||||
|
||||
<% end %>
|
||||
|
||||
|
||||
|
|
|
@ -476,12 +476,16 @@ function observeAutocompleteField(fieldId, url, options) {
|
|||
$(document).ready(function() {
|
||||
$('#'+fieldId).autocomplete($.extend({
|
||||
source: url,
|
||||
select: function(e,ui){location.href("/issues/"+ui.item.value);},
|
||||
minLength: 2,
|
||||
search: function(){$('#'+fieldId).addClass('ajax-loading');},
|
||||
response: function(){$('#'+fieldId).removeClass('ajax-loading');}
|
||||
response: function(){$('#'+fieldId).removeClass('ajax-loading');
|
||||
}
|
||||
}, options));
|
||||
$('#'+fieldId).addClass('autocomplete');
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function observeSearchfield(fieldId, targetId, url) {
|
||||
|
|
Loading…
Reference in New Issue