/* * @ngdoc fbPopover * @name fasit.directives.#fbPopover * @fbPopover * * @description * Directive som skapar flytande div med dynamiskt innehåll */ fbDeprecatedFile('fbPopover'); angular.module('fasit') .directive('fbPopover', [function () { var link = function (scope, element, attrs) { fbDeprecated('fbPopover'); scope.title = attrs.popoverTitle; scope.text = attrs.popoverText; scope.anchor = attrs.popoverAnchor; scope.ledigtNyckelNummer = attrs.popoverLedigtNyckelNr; if (attrs.popoverAnchor !== undefined) { const popoverAnchor = attrs.popoverAnchor.split(','); } scope.subText = attrs.popoverSubText; scope.danger = angular.isDefined(attrs.popoverDanger); scope.yes = function () { scope.popoverShow = false; if (scope.popoverConfirm) { scope.popoverConfirm(); } }; scope.no = function () { scope.popoverShow = false; if (scope.popoverDeny) { scope.popoverDeny(); } }; scope.$on('$destroy', function () { element.remove(); }); } var compile = function (element: fb.IRootElementService, attrs: any, linker: any): any { if (angular.isDefined(attrs.class)) { element.children().first().addClass(attrs.class); } return link; } return { compile: compile, restrict: 'AE', scope: { popoverShow:'=', popoverTitle:'@', popoverText: '@', popoverAnchor: '@', popoverLedigtNyckelNr: '@', popoverSubText: '@', popoverConfirm: '&', popoverDeny: '&', popoverPlacement: '@' }, templateUrl: 'app/Directives/fbPopover/fbPopover.html' } }]);