Mercurial > hg > soundsoftware-site
changeset 785:32d853e2e7ed cannam
Merge from branch "feature_14"
author | Chris Cannam |
---|---|
date | Fri, 18 Nov 2011 16:18:52 +0000 |
parents | 4b46e861a43a (current diff) b153713dc4fd (diff) |
children | a36cce722860 6300012e354e |
files | vendor/plugins/redmine_tags/app/views/projects/_filter_search_tags.html.erb vendor/plugins/redmine_tags/app/views/projects/index.rhtml |
diffstat | 5 files changed, 27 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/vendor/plugins/redmine_tags/app/views/projects/_filter_search_tags.html.erb Fri Nov 18 16:12:25 2011 +0000 +++ b/vendor/plugins/redmine_tags/app/views/projects/_filter_search_tags.html.erb Fri Nov 18 16:18:52 2011 +0000 @@ -7,7 +7,7 @@ <div id="project_tag_candidates" class="autocomplete"></div> <%= javascript_include_tag 'tags_input', :plugin => 'redmine_tags' %> - <%= javascript_tag "observeProjectTagsField('#{url_for(:controller => 'auto_completes', :action => 'project_search_tags', :project_id => Project.first.id)}')" %> + <%= javascript_tag "observeProjectTagsField('#{url_for(:controller => 'auto_completes', :action => 'project_search_tags', :project_id => Project.first.id)}', true)" %> </div> <% end -%> </p>
--- a/vendor/plugins/redmine_tags/app/views/projects/index.rhtml Fri Nov 18 16:12:25 2011 +0000 +++ b/vendor/plugins/redmine_tags/app/views/projects/index.rhtml Fri Nov 18 16:18:52 2011 +0000 @@ -22,7 +22,7 @@ </h2> <div style="clear:both;"></div> -<% form_remote_tag(:controller => :projects, :action => :index, :method => :get, :id => :project_filtering) do %> +<% form_remote_tag(:controller => :projects, :action => :index, :method => :get, :html => {:id => :project_filtering_form}) do %> <% if @filter_status=="true" %> <fieldset id="filters_fieldset" class="collapsible"> @@ -42,7 +42,9 @@ <%= render :partial => 'filter_search_tags' %> </div> - <p class='buttons'><%= submit_tag( l('button_filter'), :id => 'filter_button') -%></p> + <p style="display: none;"><%= submit_tag( l('button_filter'), :id => 'submitButton') -%></p> + <%= link_to l(:button_apply), {}, :onclick => "$('submitButton').click(); return false;", :class => 'icon icon-checked' %> + <%= link_to l(:button_clear), {}, :class => 'icon icon-reload' %> </div> </fieldset> <% end %>
--- a/vendor/plugins/redmine_tags/assets/javascripts/projects_index.js Fri Nov 18 16:12:25 2011 +0000 +++ b/vendor/plugins/redmine_tags/assets/javascripts/projects_index.js Fri Nov 18 16:18:52 2011 +0000 @@ -1,8 +1,3 @@ -Event.observe(window, 'load', function() { - -}); - - function toggleFieldsetWithState(this_field){ id = Element.up(this_field, 'fieldset').id; // is the fieldset collapsed? @@ -19,4 +14,8 @@ parameters: {field_id: id, status: nstatus}, asynchronous: true }); +} + +function submitForm(){ + $('submitButton').click(); return false; } \ No newline at end of file
--- a/vendor/plugins/redmine_tags/assets/javascripts/tags_input.js Fri Nov 18 16:12:25 2011 +0000 +++ b/vendor/plugins/redmine_tags/assets/javascripts/tags_input.js Fri Nov 18 16:18:52 2011 +0000 @@ -21,12 +21,14 @@ var Redmine = Redmine || {}; Redmine.TagsInput = Class.create({ - initialize: function(element) { + initialize: function(element, update) { this.element = $(element); this.input = new Element('input', { 'type': 'text', 'autocomplete': 'off', 'size': 10 }); this.button = new Element('span', { 'class': 'tag-add icon icon-add' }); this.tags = new Hash(); + this.update = update; + Event.observe(this.button, 'click', this.readTags.bind(this)); Event.observe(this.input, 'keypress', this.onKeyPress.bindAsEventListener(this)); @@ -35,15 +37,16 @@ this.addTagsList(this.element.value); }, - readTags: function() { + readTags: function() { this.addTagsList(this.input.value); this.input.value = ''; + if(this.update){submitForm();}; }, onKeyPress: function(event) { if (Event.KEY_RETURN == event.keyCode) { this.readTags(event); - Event.stop(event); + Event.stop(event); } }, @@ -57,10 +60,13 @@ this.element.value = this.getTagsList(); this.element.insert({ 'before': label }); + if(this.update){submitForm();}; + Event.observe(button, 'click', function(){ this.tags.unset(tag); this.element.value = this.getTagsList(); label.remove(); + if(this.update){submitForm();}; }.bind(this)); }, @@ -90,9 +96,13 @@ function observeIssueTagsField(url) { - new Redmine.TagsInput('issue_tag_list').autocomplete('issue_tag_candidates', url); + new Redmine.TagsInput('issue_tag_list', false).autocomplete('issue_tag_candidates', url); } -function observeProjectTagsField(url) { - new Redmine.TagsInput('project_tag_list').autocomplete('project_tag_candidates', url); +function observeProjectTagsField(url, update) { + if(!update) { + var update = false; + }; + + new Redmine.TagsInput('project_tag_list', update).autocomplete('project_tag_candidates', url); } \ No newline at end of file
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb Fri Nov 18 16:12:25 2011 +0000 +++ b/vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb Fri Nov 18 16:18:52 2011 +0000 @@ -48,21 +48,19 @@ status = params[:status] session[(field + "_status").to_sym] = status - logger.error { "SET - DEBUG-ME #{session.inspect}" } - render :nothing => true end # gets the status of the collabsible fieldsets def get_fieldset_statuses if session[:my_projects_fieldset_status].nil? - @myproj_status = true + @myproj_status = "true" else @myproj_status = session[:my_projects_fieldset_status] end if session[:filters_fieldset_status].nil? - @filter_status = false + @filter_status = "false" else @filter_status = session[:filters_fieldset_status] end