webstaff: Make the last applied template sticky
authorMike Rylander <mrylander@gmail.com>
Tue, 29 Sep 2015 18:01:42 +0000 (14:01 -0400)
committerKathy Lussier <klussier@masslnc.org>
Tue, 2 Feb 2016 19:58:47 +0000 (14:58 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>

Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index 273f589..2c6be77 100644 (file)
@@ -844,10 +844,13 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                     $scope.template_name_list = Object.keys(t);
                 }
             });
+            egCore.hatch.getItem('cat.copy.last_template').then(function(t) {
+                if (t) $scope.template_name = t;
+            });
         }
         $scope.fetchTemplates();
 
-         $scope.applyTemplate = function (n) {
+        $scope.applyTemplate = function (n) {
             angular.forEach($scope.templates[n], function (v,k) {
                 if (k == 'circ_lib') {
                     $scope.working[k] = egCore.org.get(v);
@@ -867,7 +870,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                     });
                 }
             });
-            $scope.template_name = '';
+            egCore.hatch.setItem('cat.copy.last_template', n);
         }
 
         $scope.copytab = 'working';