Tpac: expand facet display fix
authorBill Erickson <berick@esilibrary.com>
Mon, 3 Oct 2011 15:52:34 +0000 (11:52 -0400)
committerDan Scott <dscott@laurentian.ca>
Tue, 4 Oct 2011 01:06:49 +0000 (21:06 -0400)
When only one facet is collapsed, make sure we can expand it.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/templates/opac/parts/result/facets.tt2

index c4a719d..c5eb9f6 100644 (file)
@@ -28,9 +28,13 @@ FOR facet_label IN labels.sort;
                             IF fct != close_key;
                                 new_close.push(fct);
                             END;
-                        END
+                        END;
+                        expand_url = mkurl('', {close_facet => new_close});
+                        IF new_close.size == 0;
+                            expand_url  = mkurl('', {}, ['close_facet']);
+                        END;
                     %]
-                        <a href="[% mkurl('', {close_facet => new_close}) %]"><img 
+                        <a href="[% expand_url %]"><img 
                             src="[% ctx.media_prefix %]/images/adv_search_plus_btn.png" alt="[% l('Expand') %]" /></a>
                     [% ELSE %]
                         <a href="[% mkurl('', {close_facet => close_facets.merge([close_key])}) %]"><img