Fix some javascript errors, trying to access nonexistent widgets
authorPasi Kallinen <pasi.kallinen@pttk.fi>
Thu, 12 Sep 2013 08:55:36 +0000 (11:55 +0300)
committerBen Shum <bshum@biblio.org>
Thu, 13 Feb 2014 05:14:24 +0000 (00:14 -0500)
Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi>
Signed-off-by: Melissa Ceraso <mceraso@biblio.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/web/js/ui/default/actor/user/register.js

index 629b18c..671502a 100644 (file)
@@ -1197,6 +1197,7 @@ function checkClaimsReturnCountPerm() {
         'UPDATE_PATRON_CLAIM_RETURN_COUNT',
         function(orgList) { 
             var cr = findWidget('au', 'claims_returned_count');
+            if (!cr) return;
             if(orgList.indexOf(patron.home_ou()) == -1) 
                 cr.widget.attr('disabled', true);
             else
@@ -1213,6 +1214,7 @@ function checkClaimsNoCheckoutCountPerm() {
         'UPDATE_PATRON_CLAIM_NEVER_CHECKED_OUT_COUNT',
         function(orgList) { 
             var cr = findWidget('au', 'claims_never_checked_out_count');
+            if (!cr) return;
             if(orgList.indexOf(patron.home_ou()) == -1) 
                 cr.widget.attr('disabled', true);
             else
@@ -1229,6 +1231,7 @@ function checkCollectionsExemptPerm(cbox) {
     new openils.User().getPermOrgList(
         'UPDATE_PATRON_COLLECTIONS_EXEMPT',
         function(orgList) { 
+            if (!collectExemptCBox) return;
             if(orgList.indexOf(patron.home_ou()) == -1) 
                 collectExemptCBox.attr('disabled', true);
             else