LP#1541559: eliminate duplicate entries in ebook API transaction details
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Fri, 17 Feb 2017 20:51:28 +0000 (12:51 -0800)
committerKathy Lussier <klussier@masslnc.org>
Mon, 20 Feb 2017 23:54:38 +0000 (18:54 -0500)
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/web/js/ui/default/opac/ebook_api/loggedin.js

index 725d2e6..0ba1827 100644 (file)
@@ -102,6 +102,7 @@ function updateCheckoutView() {
         dojo.removeClass('no_ebook_circs', "hidden");
     } else {
         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);
@@ -134,6 +135,7 @@ function updateHoldView() {
             } else {
                 hold_status = h.queue_position + ' / ' + h.queue_size;
             }
+            dojo.empty('ebook_holds_main_table_body');
             var tr = dojo.create("tr", null, dojo.byId('ebook_holds_main_table_body'));
             dojo.create("td", { innerHTML: h.title }, tr);
             dojo.create("td", { innerHTML: h.author }, tr);
@@ -152,6 +154,7 @@ function updateHoldReadyView() {
         dojo.removeClass('no_ebook_holds', "hidden");
     } else {
         dojo.forEach(holds, function(h) {
+            dojo.empty('ebook_holds_main_table_body');
             var tr = dojo.create("tr", null, dojo.byId('ebook_holds_main_table_body'));
             dojo.create("td", { innerHTML: h.title }, tr);
             dojo.create("td", { innerHTML: h.author }, tr);