From c9fb95e59db76815e05ad124a4290439df6f8819 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 22 Feb 2018 15:44:52 -0500 Subject: [PATCH] LP#1676608: allow focus-me to accept constant A handfull of cases have arisen, including but not limited to the copy alerts feature, where focus-me is set to simply "true" rather than being bound to to a scope variable. This patch formalizes this and gets rid of the following console warning: angular.min.js:119 TypeError: model.assign is not a function at ui.js:23 at angular.min.js:160 at f (angular.min.js:45) at angular.min.js:48 (anonymous) @ angular.min.js:119 Signed-off-by: Galen Charlton Signed-off-by: Mike Rylander --- Open-ILS/web/js/ui/default/staff/services/ui.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 fb48ea0d71..b39c33b163 100644 --- a/Open-ILS/web/js/ui/default/staff/services/ui.js +++ b/Open-ILS/web/js/ui/default/staff/services/ui.js @@ -20,7 +20,8 @@ function($timeout , $parse) { }); element.bind('blur', function() { $timeout(function() { - scope.$apply(model.assign(scope, false)); + if (model.assign && typeof model.assign == 'function') + scope.$apply(model.assign(scope, false)); }); }) } -- 2.11.0