Bug 9722: Toggle display of hold notes with Edit notes button
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Mon, 4 Mar 2013 07:12:15 +0000 (08:12 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 23 May 2013 15:12:54 +0000 (08:12 -0700)
Small adjustments, requested by Kyle:
1) Rename Show notes button. It is called now: Edit notes.
2) Do not hide all other notes fields. The Edit button now only toggles
the corresponding hold notes field.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt

index c77a11e..8e58e28 100644 (file)
     // Show or hide holds notes
     $(".shownotes").click(function(){
         biblioNum = suffixOf($(this).attr("id"), "_");
-        $(".notesrow").hide();
-        $("#notesrow_"+biblioNum).show();
+        if( $("#notesrow_"+biblioNum).is(":visible") ) {
+            $("#notesrow_"+biblioNum).hide();
+        }
+        else {
+            $("#notesrow_"+biblioNum).show();
+        }
     });
 
     // When 'Place Hold' button is clicked
       <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('expiration_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear date</a></p>
     </td>[% END %]
 
-    [% IF ( OPACShowHoldNotes ) %][% IF ( bibitemloo.holdable ) %]<td><input type="button" id="shownotes_[% bibitemloo.biblionumber %]" class="shownotes" value="Show notes"/></td>[% END %][% END %]
+    [% IF ( OPACShowHoldNotes ) %][% IF ( bibitemloo.holdable ) %]<td><input type="button" id="shownotes_[% bibitemloo.biblionumber %]" class="shownotes" value="Edit notes"/></td>[% END %][% END %]
 
                     [% IF ( bibitemloo.holdable ) %]
                    <!-- HOLD ABLE -->