From bad8ab7907b9f32e0c91b027da8258df49880b9f Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 20 Jun 2017 18:10:46 -0400 Subject: [PATCH] LP#1708291: add an egHelpPopover directive This directive allows adding help text accessible by clicking on a question mark icon. Example usage: to create simple popover or to have the help text hyperlinked. Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier Signed-off-by: Dan Wells --- .../templates/staff/share/t_help_popover.tt2 | 10 ++++++++ .../web/js/ui/default/staff/services/ui.js | 23 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 Open-ILS/src/templates/staff/share/t_help_popover.tt2 diff --git a/Open-ILS/src/templates/staff/share/t_help_popover.tt2 b/Open-ILS/src/templates/staff/share/t_help_popover.tt2 new file mode 100644 index 0000000000..215400aa52 --- /dev/null +++ b/Open-ILS/src/templates/staff/share/t_help_popover.tt2 @@ -0,0 +1,10 @@ + + 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 10766fffe6..6513459c2f 100644 --- a/Open-ILS/web/js/ui/default/staff/services/ui.js +++ b/Open-ILS/web/js/ui/default/staff/services/ui.js @@ -1024,6 +1024,29 @@ function($window , egStrings) { } }) +/* + * egHelpPopover - a helpful widget + */ +.directive('egHelpPopover', function() { + return { + restrict : 'E', + transclude : true, + scope : { + helpText : '@', + helpLink : '@' + }, + templateUrl : './share/t_help_popover', + controller : ['$scope','$sce', function($scope , $sce) { + if ($scope.helpLink) { + $scope.helpHtml = $sce.trustAsHtml( + '' + + $scope.helpText + '' + ); + } + }] + } +}) + .factory('egWorkLog', ['egCore', function(egCore) { var service = {}; -- 2.43.2