allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [13/38] git commit: [#4019] ticket:481 Make filter and displayed columns work together
Date Wed, 30 Apr 2014 18:15:45 GMT
[#4019] ticket:481 Make filter and displayed columns work together


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/d7cf7f9f
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/d7cf7f9f
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/d7cf7f9f

Branch: refs/heads/master
Commit: d7cf7f9f63fb6baceda8c1c33725f14cc83e4f57
Parents: f390403
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu Dec 19 15:17:28 2013 +0200
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Apr 30 15:55:10 2014 +0000

----------------------------------------------------------------------
 .../tracker_widgets/ticket_search_results.html        |  1 +
 .../forgetracker/widgets/resources/js/ticket-list.js  | 14 ++++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/d7cf7f9f/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
b/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
index f16f33e..e7827cf 100644
--- a/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
+++ b/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
@@ -109,6 +109,7 @@
       <input type="hidden" name="sort" value="{{sort}}">
       {% endif %}
       <input type="hidden" name="q" value="{{query}}">
+      <input type="hidden" name="filter" value="{{filter}}">
       <ul>
       {% for col in columns %}
         <li class="clear">

http://git-wip-us.apache.org/repos/asf/allura/blob/d7cf7f9f/ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js b/ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js
index 558a9fb..32aee5f 100644
--- a/ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js
+++ b/ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js
@@ -23,12 +23,22 @@
       $this.html($this.html().replace(/\//gi,'/&#8203;'));
     });
 
-    function requery(){
-        window.location = '?q=' + q +
+    function requery() {
+        var location = '?q=' + q +
                           '&limit=' + limit +
                           '&page=' + page +
                           '&sort=' + encodeURIComponent(sort) +
                           '&filter=' + encodeURIComponent(JSON.stringify(filter));
+        // preserve displayed columns, when filter changes
+        $('#col_list_form input').each(function() {
+            if (this.name.indexOf('columns-') == 0) {
+                var inp = $(this);
+                var val = inp.val();
+                if (inp.is(':checkbox') && !inp.is(':checked')) { val = ''; }
+                location += '&' + this.name + '=' + encodeURIComponent(val);
+            }
+        });
+        window.location = location;
     }
 
     $('.ticket-filter a[data-sort]').click(function(){


Mime
View raw message