getting changes to stick within a session
authorJason Etheridge <jason@esilibrary.com>
Fri, 10 Jun 2016 18:16:22 +0000 (14:16 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 18 Aug 2016 19:34:22 +0000 (15:34 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/web/js/ui/default/staff/admin/actor/org_unit/app.js

index bd24c80..6632bdc 100644 (file)
@@ -37,6 +37,9 @@ function($scope , $q , $routeParams , $window , egCore , egOrg  ) {
             function(res) { // success
                 console.log('handler1');
                 window.handler1 = res;
+                window.sessionStorage.removeItem('eg.env.aou.tree');
+                egCore.env.load();
+                init(0);
             },
             function(res) { // success
                 console.log('handler2');
@@ -57,9 +60,18 @@ function($scope , $q , $routeParams , $window , egCore , egOrg  ) {
 
     // the org tree
 
-    $scope.treedata = [ egCore.idl.toHash( egOrg.tree() ) ];
-    $scope.selected = $scope.treedata[0]; // FIXME -- why no work?
-    $scope.expandedNodes = [ $scope.treedata[0] ];
+    function init(n) {
+        $scope.treedata = [ egCore.idl.toHash( egOrg.tree() ) ];
+        $scope.selected = $scope.treedata[0]; // FIXME -- why no work?
+        $scope.expandedNodes = [ $scope.treedata[0], $scope.selected ];
+    }
+    init(1);
+
+    window.phasefx = {
+         'scope' : $scope
+        ,'egorg' : egOrg
+        ,'egcore' : egCore
+    };
 
     $scope.showSelected = function(sel) {
         $scope.selectedNode = sel;