JBAS-1728 SCKO Login return button clears BC entry
authorBill Erickson <berickxx@gmail.com>
Mon, 18 Sep 2017 16:39:47 +0000 (09:39 -0700)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
window.reload() appears to leave the value in the barcode entry box
after the user clicks Return To Login.  It also takes a long time, since
it's reloading.  Teach the link to use the same href setting code that
the auto-return-to-login-page code uses.  It clears the barcode box and
runs much faster.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js

index af4551b..76581c7 100644 (file)
@@ -200,7 +200,6 @@ SelfCheckManager.prototype.init = function() {
             self.drawFinesPage();
             openils.Util.show('oils-selfck-fines-tbody');
         },
-        'oils-selfck-nav-return-login' : function() { window.location.reload() },
         'oils-selfck-nav-logout' : function() { self.logoutPatron(); },
         'oils-selfck-nav-logout-print' : function() { self.logoutPatron(true); },
         'oils-selfck-nav-logout-email' : function() { self.logoutPatron(false, true); },
@@ -1752,7 +1751,13 @@ SelfCheckManager.prototype.processLogout = function() {
     // dict of org unit settings for "here"
     this.orgSettings = {};
 
-    setTimeout(function() {location.href = return_url;}, thankYouPageTimeout);
+    var goHomeFunc = function() {location.href = return_url};
+
+    // "return to login" link
+    dojo.connect(dojo.byId('oils-selfck-nav-return-login'), 'onclick', goHomeFunc);
+
+    // automatically redirect if return link is not clicked
+    setTimeout(goHomeFunc, thankYouPageTimeout);
 }
 
 //TODO: Remove