Skip to content

Commit

Permalink
Merge pull request #19 from shashwatblack/ISS18_fix-for-custom-popove…
Browse files Browse the repository at this point in the history
…r-template

Added checks for whether attributes popover-template, popover-is-open…
  • Loading branch information
mrsteele authored Sep 22, 2016
2 parents a5aab71 + 7006b5f commit f9982fc
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/directives/ng-alerts-popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,23 @@ angular.module('ngAlerts').directive('ngAlertsPopover', [
priority: 1000,
link: function ($scope, $element, $attrs) {

$element.attr('uib-popover-template', 'templateUrl');
$element.attr('popover-is-open', 'isOpen');
if (!$attrs.uibPopoverTemplate) {
$element.attr('uib-popover-template', 'templateUrl');
}

if (!$attrs.popoverIsOpen) {
$element.attr('popover-is-open', 'isOpen');
}

$element.removeAttr('ng-alerts-popover');

if (!$attrs.popoverTrigger) {
$element.attr('popover-trigger', 'outsideClick');
}

$element.attr('popover-class', 'ng-alerts-popover-list');
if (!$attrs.popoverClass) {
$element.attr('popover-class', 'ng-alerts-popover-list');
}

$scope.templateUrl = 'template/ng-alerts/sub/popover-list.html';
$scope.emptyText = $attrs.emptyText;
Expand Down

0 comments on commit f9982fc

Please sign in to comment.