Bug 21588: Add expand/collapse all links to the "Acquisition details" subscriptions
[koha-equinox.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / subscription-detail.tt
index a30270a..d7f7cfd 100644 (file)
                 <caption>
                   <span class="actions">
                   <a href="#" id="hide_received_orders">Hide already received orders</a>
-                  | <a href="#" id="show_all_orders">Show all orders</a></span>
+                  | <a href="#" id="show_all_orders">Show all orders</a>
+                  | <a href="#" id="expand_all">Expand all</a>
+                  | <a href="#" id="collapse_all">Collapse all</a>
+                  </span>
                 </caption>
 
                 <thead>
 
             [% IF orders_grouped.size %]
                 $(table).treetable({
-                    expandable: true
+                    expandable: true,
+                    initialState: 'expanded',
                 });
                 $(table).treetable('expandAll');
+
+                $("#expand_all").click(function(e){
+                    e.preventDefault();
+                    $(table).treetable('expandAll');
+                });
+                $("#collapse_all").click(function(e){
+                    e.preventDefault();
+                    $(table).treetable('collapseAll');
+                });
+
             [% END %]
 
             $("#hide_received_orders").click(function(e){