From: Galen Charlton Date: Thu, 6 Jul 2017 21:14:36 +0000 (-0400) Subject: webstaff: improve focus management of subscription manager X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b462077b25efee67070ee6a8379b863047c04daf;p=working%2FEvergreen.git webstaff: improve focus management of subscription manager Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/templates/staff/serials/t_subscription_manager.tt2 b/Open-ILS/src/templates/staff/serials/t_subscription_manager.tt2 index 3743d16e8a..8f610455f3 100644 --- a/Open-ILS/src/templates/staff/serials/t_subscription_manager.tt2 +++ b/Open-ILS/src/templates/staff/serials/t_subscription_manager.tt2 @@ -12,7 +12,7 @@
-
+
@@ -33,7 +33,7 @@
- +
@@ -49,7 +49,7 @@
- +
- +
@@ -81,7 +81,7 @@
- +
diff --git a/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js b/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js index 8756bc7e68..9f0d049957 100644 --- a/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js +++ b/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js @@ -63,16 +63,21 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider , var new_ssub = egCore.idl.toTypedHash(new egCore.idl.ssub()); new_ssub._isnew = true; new_ssub.record_entry = $scope.bibId; + new_ssub._focus_me = true; $scope.subscriptions.push(new_ssub); $scope.add_distribution(new_ssub); // since we know we want at least one distribution } - $scope.add_distribution = function(ssub) { + $scope.add_distribution = function(ssub, grab_focus) { var new_sdist = egCore.idl.toTypedHash(new egCore.idl.sdist()); new_sdist._isnew = true; new_sdist.subscription = ssub.id; if (!angular.isArray(ssub.distributions)){ ssub.distributions = []; } + if (grab_focus) { + new_sdist._focus_me = true; + ssub._focus_me = false; + } ssub.distributions.push(new_sdist); $scope.add_stream(new_sdist); // since we know we want at least one stream } @@ -88,10 +93,14 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider , ssub.distributions.splice(to_remove, 1); } } - $scope.add_stream = function(sdist) { + $scope.add_stream = function(sdist, grab_focus) { var new_sstr = egCore.idl.toTypedHash(new egCore.idl.sstr()); new_sstr.distribution = sdist.id; new_sstr._isnew = true; + if (grab_focus) { + new_sstr._focus_me = true; + sdist._has_focus = false; // and take focus away from a newly created sdist + } if (!angular.isArray(sdist.streams)){ sdist.streams = []; }