From 00d828090abc0dfe6d72525e91aba4b61cfc51ab Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Fri, 21 Aug 2015 13:23:12 -0400 Subject: [PATCH] webstaff: Teach org selector to be completely disabled via text attr Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- Open-ILS/web/js/ui/default/staff/services/ui.js | 11 ++++++++++- 1 file changed, 10 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 966b3e3f15..aa5d0b75e8 100644 --- a/Open-ILS/web/js/ui/default/staff/services/ui.js +++ b/Open-ILS/web/js/ui/default/staff/services/ui.js @@ -259,6 +259,9 @@ function($modal, $interpolate) { // org unit will not be available for selection. disableTest : '=', + // if set to true, disable the UI element altogether + alldisabled : '@', + // Caller can either $watch(selected, ..) or register an // onchange handler. onchange : '=', @@ -270,7 +273,7 @@ function($modal, $interpolate) { // any reason to move this into a TT2 template? template : '
' - + '' @@ -287,6 +290,12 @@ function($modal, $interpolate) { controller : ['$scope','$timeout','egOrg','egAuth', function($scope , $timeout , egOrg , egAuth) { + if ($scope.alldisabled) { + $scope.disable_button = $scope.alldisabled == 'true' ? true : false; + } else { + $scope.disable_button = false; + } + $scope.egOrg = egOrg; // for use in the link function $scope.egAuth = egAuth; // for use in the link function -- 2.11.0