'use strict'; angular.module('quantum').directive('quickLinks', ['$http','$window', function($http,$window){ return { restrict: 'E', scope:{ ngModel: '=' }, template: "
" + "{{quickLink.reportName}} - {{quickLink.reportDescr}}" + "{{quickLink.reportName}} - {{quickLink.reportDescr}}" + "
", link: function($scope,element,attr){ $scope.ngDisplayType=attr.ngDisplayType; $scope.popUpWindowSize = "top=" + ((screen.height*.2)/2) + ",left=" + ((screen.width*.05)/2) + ",width="+(screen.width-(screen.width*.06))+",height="+(screen.height-(screen.height*.25)); $scope.openLink = function(url){ if($scope.ngDisplayType){ if($scope.ngDisplayType=='1'){ $window.open(url,'_self'); }else if($scope.ngDisplayType=='2'){ $window.open(url, '_blank'); }else if($scope.ngDisplayType=='3'){ $window.open(url, '', $scope.popUpWindowSize); } } }; $http.get('raptor.htm?action=quicklinks.json&quick_links_menu_id='+attr.ngMenuId).then(function(result){ $scope.quickLinks=result.data; }); } }; }]);