LP#1673870: fix bug that prevented more than one ebook transaction from appearing...
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Wed, 28 Jun 2017 20:49:37 +0000 (13:49 -0700)
committerBill Erickson <berickxx@gmail.com>
Fri, 1 Sep 2017 20:06:50 +0000 (16:06 -0400)
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/default/opac/ebook_api/loggedin.js

index 6f73789..be520d5 100644 (file)
@@ -111,8 +111,8 @@ function updateCheckoutView() {
     if (xacts.checkouts.length < 1) {
         dojo.removeClass('no_ebook_circs', "hidden");
     } else {
+        dojo.empty('ebook_circs_main_table_body');
         dojo.forEach(xacts.checkouts, function(x) {
-            dojo.empty('ebook_circs_main_table_body');
             var dl_link = '<a href="' + x.download_url + '">' + l_strings.download + '</a>';
             var tr = dojo.create("tr", null, dojo.byId('ebook_circs_main_table_body'));
             dojo.create("td", { innerHTML: x.title }, tr);
@@ -141,6 +141,7 @@ function updateHoldView() {
     if (holds.length < 1) {
         dojo.removeClass('no_ebook_holds', "hidden");
     } else {
+        dojo.empty('ebook_holds_main_table_body');
         dojo.forEach(holds, function(h) {
             var hold_status;
             if (h.is_ready) {
@@ -167,7 +168,6 @@ function updateHoldView() {
                     }
                 });
             };
-            dojo.empty('ebook_holds_main_table_body');
             var tr = dojo.create("tr", { id: "hold-" + h.title_id }, dojo.byId('ebook_holds_main_table_body'));
             dojo.create("td", { innerHTML: h.title }, tr);
             dojo.create("td", { innerHTML: h.author }, tr);