From: Galen Charlton Date: Thu, 24 Sep 2015 18:33:58 +0000 (+0000) Subject: webstaff: teach egConfirmDialog how to set custom labels for buttons X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9bcc91a67131a496ae5c6658eaf684bed1b7a10f;p=evergreen%2Fpines.git webstaff: teach egConfirmDialog how to set custom labels for buttons egConfirmDialog() now accepts optional fourth and fifth arguments to set custom labels for the "OK" and "cancel" buttons. Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- diff --git a/Open-ILS/src/templates/staff/share/t_confirm_dialog.tt2 b/Open-ILS/src/templates/staff/share/t_confirm_dialog.tt2 index 45e8ca1609..a9d6ac17e0 100644 --- a/Open-ILS/src/templates/staff/share/t_confirm_dialog.tt2 +++ b/Open-ILS/src/templates/staff/share/t_confirm_dialog.tt2 @@ -11,8 +11,8 @@ 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 49603177e2..5264d68591 100644 --- a/Open-ILS/web/js/ui/default/staff/services/ui.js +++ b/Open-ILS/web/js/ui/default/staff/services/ui.js @@ -109,7 +109,8 @@ function($modal , $interpolate) { /** * egConfirmDialog.open("some message goes {{here}}", { - * here : 'foo', ok : function() {}, cancel : function() {}}); + * here : 'foo', ok : function() {}, cancel : function() {}}, + * 'OK', 'Cancel'); */ .factory('egConfirmDialog', @@ -117,13 +118,15 @@ function($modal , $interpolate) { function($modal, $interpolate) { var service = {}; - service.open = function(title, message, msg_scope) { + service.open = function(title, message, msg_scope, ok_button_label, cancel_button_label) { return $modal.open({ templateUrl: './share/t_confirm_dialog', controller: ['$scope', '$modalInstance', function($scope, $modalInstance) { $scope.title = $interpolate(title)(msg_scope); $scope.message = $interpolate(message)(msg_scope); + $scope.ok_button_label = $interpolate(ok_button_label || '')(msg_scope); + $scope.cancel_button_label = $interpolate(cancel_button_label || '')(msg_scope); $scope.ok = function() { if (msg_scope.ok) msg_scope.ok(); $modalInstance.close()