TPac: clicking on open "extras" tab closes the tab
authorBill Erickson <berick@esilibrary.com>
Fri, 16 Sep 2011 20:32:34 +0000 (16:32 -0400)
committerBill Erickson <berick@esilibrary.com>
Fri, 16 Sep 2011 20:32:34 +0000 (16:32 -0400)
In record detail page, if a tab (e.g. Subjects) is open, clicking on the
tab header again will close the tab.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/opac/parts/record/extras.tt2

index a9e03ad..7c7339d 100644 (file)
         <div class="rdetail_extras">
             <div class="rdetail_extras_hr"></div>
             <div class="rdetail_extras_link">
-                [%  href = mkurl('', {expand => name}) _ '#' _ name; 
-                    img_url = ctx.media_prefix _ '/images/rdetail_arrow' _ (tab_is_active(name) ? '_down' : '') _ '.png' 
+                [%  
+                    IF tab_is_active(name);
+                        href = mkurl('', {}, ['expand']);
+                        img_url = ctx.media_prefix _ '/images/rdetail_arrow_down.png';
+                    ELSE;
+                        href = mkurl('', {expand => name}) _ '#' _ name; 
+                        img_url = ctx.media_prefix _ '/images/rdetail_arrow.png';
+                    END;
                 %]
                 <a name='[% name %]' href='[% href %]'><img alt='[% extra.label %]' src='[% img_url %]'/></a>
                 <a href='[% href %]' class="rdetail_extras_lbl">[% extra.label %]</a>