From: Jason Etheridge Date: Fri, 10 Jun 2016 18:17:13 +0000 (-0400) Subject: refactor X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=aca3dd932957a062eb5f6385bb89d3dfae08d011;p=evergreen%2Fmasslnc.git refactor Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/web/js/ui/default/staff/admin/actor/org_unit/app.js b/Open-ILS/web/js/ui/default/staff/admin/actor/org_unit/app.js index 6632bdc99e..323288e592 100644 --- a/Open-ILS/web/js/ui/default/staff/admin/actor/org_unit/app.js +++ b/Open-ILS/web/js/ui/default/staff/admin/actor/org_unit/app.js @@ -27,31 +27,6 @@ angular.module('egOrgUnitApp', ['$scope','$q','$routeParams','$window','egCore','egOrg', function($scope , $q , $routeParams , $window , egCore , egOrg ) { - $scope.update = function() { - var new_org = egOrg.get($scope.org.id); - new_org.name( $scope.org.name ); - new_org.shortname( $scope.org.shortname ); - new_org.email( $scope.org.email ); - new_org.phone( $scope.org.phone ); - egCore.pcrud.update(new_org).then( - 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'); - window.handler2 = res; - }, - function(res) { // error - console.log('handler3'); - window.handler3 = res; - } - ); - }; - $scope.reset = function() { $scope.org = angular.copy($scope.selectedNode); }; @@ -96,5 +71,35 @@ function($scope , $q , $routeParams , $window , egCore , egOrg ) { } } + // main tab behavior + + $scope.update = function() { + var new_org = egOrg.get($scope.org.id); + new_org.name( $scope.org.name ); + new_org.shortname( $scope.org.shortname ); + new_org.email( $scope.org.email ); + new_org.phone( $scope.org.phone ); + egCore.pcrud.update(new_org).then( + 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'); + window.handler2 = res; + }, + function(res) { // error + console.log('handler3'); + window.handler3 = res; + } + ); + }; + + + + }])