Revision 785:32d853e2e7ed

View differences:

vendor/plugins/redmine_tags/app/views/projects/_filter_search_tags.html.erb
7 7
      <div id="project_tag_candidates" class="autocomplete"></div>
8 8
      <%= javascript_include_tag 'tags_input', :plugin => 'redmine_tags' %>
9 9

  
10
      <%= javascript_tag "observeProjectTagsField('#{url_for(:controller => 'auto_completes', :action => 'project_search_tags', :project_id => Project.first.id)}')" %>
10
      <%= javascript_tag "observeProjectTagsField('#{url_for(:controller => 'auto_completes', :action => 'project_search_tags', :project_id => Project.first.id)}', true)" %>
11 11
    </div>
12 12
  <% end -%>
13 13
</p>
vendor/plugins/redmine_tags/app/views/projects/index.rhtml
22 22
</h2>
23 23

  
24 24
<div style="clear:both;"></div>
25
<% form_remote_tag(:controller => :projects, :action => :index, :method => :get, :id => :project_filtering) do %>
25
<% form_remote_tag(:controller => :projects, :action => :index, :method => :get, :html => {:id => :project_filtering_form}) do %>
26 26

  
27 27
<% if @filter_status=="true" %>
28 28
<fieldset id="filters_fieldset" class="collapsible">
......
42 42
        <%= render :partial => 'filter_search_tags' %>
43 43
      </div>
44 44

  
45
      <p class='buttons'><%= submit_tag( l('button_filter'), :id => 'filter_button') -%></p>                  
45
      <p style="display: none;"><%= submit_tag( l('button_filter'), :id => 'submitButton') -%></p>
46
      <%= link_to l(:button_apply), {}, :onclick => "$('submitButton').click(); return false;", :class => 'icon icon-checked' %>      
47
      <%= link_to l(:button_clear), {}, :class => 'icon icon-reload'  %>                         
46 48
    </div>
47 49
  </fieldset>
48 50
<% end %>
vendor/plugins/redmine_tags/assets/javascripts/projects_index.js
1
Event.observe(window, 'load', function() {
2

  
3
});
4

  
5

  
6 1
function toggleFieldsetWithState(this_field){
7 2
	id = Element.up(this_field, 'fieldset').id;	
8 3
	// is the fieldset collapsed?
......
19 14
	 	parameters: {field_id: id, status: nstatus},
20 15
    	asynchronous: true
21 16
  	});
17
}
18

  
19
function submitForm(){
20
	$('submitButton').click(); return false;
22 21
}
vendor/plugins/redmine_tags/assets/javascripts/tags_input.js
21 21
var Redmine = Redmine || {};
22 22

  
23 23
Redmine.TagsInput = Class.create({
24
  initialize: function(element) {
24
  initialize: function(element, update) {
25 25
    this.element  = $(element);
26 26
    this.input    = new Element('input', { 'type': 'text', 'autocomplete': 'off', 'size': 10 });
27 27
    this.button   = new Element('span', { 'class': 'tag-add icon icon-add' });
28 28
    this.tags     = new Hash();
29 29
    
30
		this.update = update;
31

  
30 32
    Event.observe(this.button, 'click', this.readTags.bind(this));
31 33
    Event.observe(this.input, 'keypress', this.onKeyPress.bindAsEventListener(this));
32 34

  
......
35 37
    this.addTagsList(this.element.value);
36 38
  },
37 39

  
38
  readTags: function() {
40
  readTags: function() {		
39 41
    this.addTagsList(this.input.value);
40 42
    this.input.value = '';
43
		if(this.update){submitForm();};
41 44
  },
42 45

  
43 46
  onKeyPress: function(event) {
44 47
    if (Event.KEY_RETURN == event.keyCode) {
45 48
      this.readTags(event);
46
      Event.stop(event);
49
      Event.stop(event);			
47 50
    }
48 51
  },
49 52

  
......
57 60
    this.element.value = this.getTagsList();
58 61
    this.element.insert({ 'before': label });
59 62

  
63
		if(this.update){submitForm();};
64

  
60 65
    Event.observe(button, 'click', function(){
61 66
      this.tags.unset(tag);
62 67
      this.element.value = this.getTagsList();
63 68
      label.remove();
69
		  if(this.update){submitForm();};
64 70
    }.bind(this));
65 71
  },
66 72

  
......
90 96

  
91 97

  
92 98
function observeIssueTagsField(url) {
93
  new Redmine.TagsInput('issue_tag_list').autocomplete('issue_tag_candidates', url);
99
  new Redmine.TagsInput('issue_tag_list', false).autocomplete('issue_tag_candidates', url);
94 100
}
95 101

  
96
function observeProjectTagsField(url) {
97
	new Redmine.TagsInput('project_tag_list').autocomplete('project_tag_candidates', url);
102
function observeProjectTagsField(url, update) {
103
	if(!update) { 
104
			var update = false;
105
		};
106
	
107
	new Redmine.TagsInput('project_tag_list', update).autocomplete('project_tag_candidates', url);
98 108
}
vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb
48 48
          status = params[:status]
49 49

  
50 50
          session[(field + "_status").to_sym] = status
51
          logger.error { "SET - DEBUG-ME #{session.inspect}" }
52

  
53 51
          render :nothing => true
54 52
        end
55 53

  
56 54
        # gets the status of the collabsible fieldsets
57 55
        def get_fieldset_statuses
58 56
          if session[:my_projects_fieldset_status].nil?
59
            @myproj_status = true
57
            @myproj_status = "true"
60 58
          else
61 59
            @myproj_status = session[:my_projects_fieldset_status]
62 60
          end
63 61
                    
64 62
          if session[:filters_fieldset_status].nil?
65
            @filter_status = false
63
            @filter_status = "false"
66 64
          else
67 65
            @filter_status = session[:filters_fieldset_status]
68 66
          end                            

Also available in: Unified diff