webstaff: Make alert type selection sticky when an alert is saved
authorMike Rylander <mrylander@gmail.com>
Thu, 14 Apr 2016 20:07:08 +0000 (16:07 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 27 Mar 2017 20:20:55 +0000 (16:20 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index f6717bb..6503278 100644 (file)
@@ -1642,6 +1642,10 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                     temp         : false
                 };
 
+                egCore.hatch.getItem('cat.copy.alerts.last_type').then(function(t) {
+                    if (t) $scope.copy_alert.alert_type = t;
+                });
+
                 if (copy_list.length == 1) {
                     $scope.copy_alert_list = copy_list[0].copy_alerts();
                 }
@@ -1665,6 +1669,14 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                             );
                             cp.copy_alerts().push( a );
                         });
+
+                        if (copy_alert.alert_type) {
+                            egCore.hatch.setItem(
+                                'cat.copy.alerts.last_type',
+                                copy_alert.alert_type
+                            );
+                        }
+
                     }
 
                     $modalInstance.close();