JBAS-1728 SCKO clear notices on navigation
authorBill Erickson <berickxx@gmail.com>
Tue, 27 Jun 2017 16:14:47 +0000 (12:14 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Remove the patron checkout and renewal event notifications from the UI
any time navigation occurs.

Fix HTML syntax error for back_button onlick handler.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/openils/var/templates_kcls/circ/selfcheck/main.tt2
Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js

index cec6ff7..7f118c1 100644 (file)
@@ -10,7 +10,9 @@
 
 <script type="text/javascript">
 function switchTo(str,subpage) {
+  console.debug('switchTo() page: ' + str + ' subpage: ' + subpage);
   selfckResetTimer(); // reset login timer
+
   var pages = [];
   var sidebarLinks = [];
   pages['step0'] = document.getElementById('step0');
@@ -39,7 +41,16 @@ function switchTo(str,subpage) {
   }
   pages[str].style.display="block";
   if(str=='step3' && !subpage) pages['step3a'].style.display="block";
-  try{dojo.byId('selfckScanBox').focus();dojo.byId('selfckScanBox').select();}catch(e){}
+
+  try {
+    // Re-focus scan box during navigation.
+    dojo.byId('selfckScanBox').focus();
+    dojo.byId('selfckScanBox').select();
+
+    // NOTE: switchTo() is called in the midst of various actions, 
+    // so we can't clear the notifications here.
+    // dojo.byId('oils-selfck-status-div').innerHTML = '';
+  } catch(e) {}
 }
 </script>
 
@@ -148,7 +159,9 @@ function switchTo(str,subpage) {
           </div>
 
           <div class="col-md-12 pad-vert-btn">
-            <a href="javascript:; id="back_button"" onclick="switchTo('step3');" class="btn btn-primary">
+            <a href="javascript:;" id="back_button" 
+              onclick="switchTo('step3'); dojo.byId('oils-selfck-status-div').innerHTML = '';"
+              class="btn btn-primary">
               <img alt='back to checkout' class="scko-btn-to-checkout" src="[% ctx.media_prefix %]/images/selfcheck/arrow.png"/>
               <span>Back to Check-out</span></a>
           </div>
index 5ecdd8d..b52b924 100644 (file)
@@ -597,6 +597,7 @@ SelfCheckManager.prototype.updateFinesSummary = function() {
 
 SelfCheckManager.prototype.drawItemsOutPage = function() {
     switchTo('step3','step3d');
+    dojo.byId('oils-selfck-status-div').innerHTML = ''; // reset notices
 
     // Reset items checked out in case it changed
     this.circSummary = undefined;
@@ -795,6 +796,7 @@ SelfCheckManager.prototype.updateCircSummary = function(increment) {
 
 SelfCheckManager.prototype.drawHoldsPage = function() {
     switchTo('step3','step3e');
+    dojo.byId('oils-selfck-status-div').innerHTML = ''; // reset notices
 
     this.holdTbody = dojo.byId('oils-selfck-hold-tbody');
     this.readyTbody = dojo.byId('oils-selfck-rdy-tbody');
@@ -915,6 +917,8 @@ SelfCheckManager.prototype.drawFinesPage = function() {
     // this.updateScanBox(...)
 
     switchTo('step3','step3c');
+    dojo.byId('oils-selfck-status-div').innerHTML = ''; // reset notices
+
     progressDialog.show(true);
 
     this.finesTbody = dojo.byId('oils-selfck-fines-tbody');