]> source.dussan.org Git - redmine.git/commitdiff
Fixed: pressing enter in filters should result to an 'apply', not a 'save'. #2285
authorJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Thu, 16 Sep 2010 21:33:49 +0000 (21:33 +0000)
committerJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Thu, 16 Sep 2010 21:33:49 +0000 (21:33 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4093 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/issues/index.rhtml
app/views/queries/_filters.rhtml

index ee6514d0b6709190035a50d4dcc255f7e5e9b2e0..ddd5d90800011f976cbcff7caf7a8f80b33f8d57 100644 (file)
@@ -39,6 +39,7 @@
                        { :url => { :set_filter => 1 },
                          :before => 'selectAllOptions("selected_columns");',
                          :update => "content",
+                         :complete => "apply_filters_observer()",
                          :with => "Form.serialize('query_form')"
                        }, :class => 'icon icon-checked' %>
                        
index 58ea1524c6267aaae4c0181b34daa99f8af8a775..20640eb8de2fd3052e642c541f003181a16d3a32 100644 (file)
@@ -53,6 +53,18 @@ function toggle_multi_select(field) {
         select.multiple = true;
     }
 }
+
+function apply_filters_observer() {
+  $$("#query_form input[type=text]").invoke("observe", "keypress", function(e){
+    if(e.keyCode == Event.KEY_RETURN) {
+      <%= remote_function(:url => { :set_filter => 1},
+                          :update => "content",
+                          :with => "Form.serialize('query_form')",
+                          :complete => "e.stop(); apply_filters_observer()") %>
+    }
+  });
+}
+Event.observe(document,"dom:loaded", apply_filters_observer);
 //]]>
 </script>