This directive allows adding help text accessible by clicking
on a question mark icon. Example usage:
<eg-help-popover help-text="Use the Force, Leia!">
to create simple popover or
<eg-help-popover help-text="Learn MARC21"
help-link="https://www.loc.gov/marc"
>
to have the help text hyperlinked.
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
--- /dev/null
+<span class="glyphicon glyphicon-question-sign"
+ uib-popover="{{helpText}}"
+ popover-trigger="click"
+ ng-if="!helpLink || helpLink.length == 0"
+></span>
+<span class="glyphicon glyphicon-question-sign"
+ uib-popover-html="helpHtml"
+ popover-trigger="click"
+ ng-if="helpLink.length > 0"
+></span>
}
})
+/*
+ * 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(
+ '<a target="_new" href="' + $scope.helpLink + '">' +
+ $scope.helpText + '</a>'
+ );
+ }
+ }]
+ }
+})
+
.factory('egWorkLog', ['egCore', function(egCore) {
var service = {};