webstaff: improve initialization of egTable.authorityControlSet()
authorGalen Charlton <gmc@esilibrary.com>
Mon, 31 Aug 2015 17:33:30 +0000 (17:33 +0000)
committerJason Stephenson <jstephenson@mvlc.org>
Mon, 14 Sep 2015 19:44:17 +0000 (15:44 -0400)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/web/js/ui/default/staff/cat/services/tagtable.js

index b40597e..6b40c9c 100644 (file)
@@ -350,6 +350,11 @@ function($q,   egCore,   egAuth) {
             }).then(function() {
                 service.authority_control_set._remote_loaded = true;
                 parent._parse();
+                if (kwargs.controlSet) {
+                    parent.controlSetId( kwargs.controlSet );
+                } else {
+                    parent.controlSetId( parent.controlSetList().sort(function(a,b){return (a - b)}) );
+                }
             });
         }
 
@@ -487,13 +492,7 @@ function($q,   egCore,   egAuth) {
                 this.bibToAuthorities(field)
             );
         }
-    
-        if (kwargs.controlSet) {
-            this.controlSetId( kwargs.controlSet );
-        } else {
-            this.controlSetId( this.controlSetList().sort(function(a,b){return (a - b)}) );
-        }
-    
+
     }
 
     return service;