From e7a4b69d68cedf24fcbf70acfe2d74fc566da6e4 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 7 Mar 2017 12:25:32 -0500 Subject: [PATCH] LP#1670512 Apply focus/select model udpates via timeout Avoid manually invoking scope.$apply() in the midst of an angular $digest loop, since this is forbidden by angular. Wrap the apply()'s in a $timeout, so they occur after the currently running digest. Fixes the focusMe, blurMe, and selectMe directives. Signed-off-by: Bill Erickson Signed-off-by: Kathy Lussier --- Open-ILS/web/js/ui/default/staff/services/ui.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/services/ui.js b/Open-ILS/web/js/ui/default/staff/services/ui.js index 5d73487ddd..7328e7d015 100644 --- a/Open-ILS/web/js/ui/default/staff/services/ui.js +++ b/Open-ILS/web/js/ui/default/staff/services/ui.js @@ -19,7 +19,9 @@ function($timeout , $parse) { $timeout(function() {element[0].focus()}); }); element.bind('blur', function() { - scope.$apply(model.assign(scope, false)); + $timeout(function() { + scope.$apply(model.assign(scope, false)); + }); }) } }; @@ -41,7 +43,9 @@ function($timeout , $parse) { $timeout(function() {element[0].blur()}); }); element.bind('focus', function() { - scope.$apply(model.assign(scope, false)); + $timeout(function() { + scope.$apply(model.assign(scope, false)); + }); }) } }; @@ -61,7 +65,9 @@ function($timeout , $parse) { $timeout(function() {element[0].select()}); }); element.bind('blur', function() { - scope.$apply(model.assign(scope, false)); + $timeout(function() { + scope.$apply(model.assign(scope, false)); + }); }) } }; -- 2.43.2