Iftekharul Islam | 8b4828a | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 1 | window.angular && (function (angular) { |
| 2 | 'use strict'; |
| 3 | |
| 4 | angular |
| 5 | .module('app.common.directives') |
| 6 | .directive('logEvent', ['APIUtils', function (APIUtils) { |
| 7 | return { |
| 8 | 'restrict': 'E', |
Ed Tanous | bbcf670 | 2017-10-06 13:53:06 -0700 | [diff] [blame^] | 9 | 'template': require('./log-event.html'), |
Iftekharul Islam | 8b4828a | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 10 | 'scope': { |
| 11 | 'event': '=', |
Iftekharul Islam | 96bbf31 | 2017-08-22 13:44:38 -0500 | [diff] [blame] | 12 | 'tmz': '=', |
| 13 | 'multiSelected': '=' |
Iftekharul Islam | 8b4828a | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 14 | }, |
| 15 | 'controller': ['$rootScope', '$scope','dataService', '$location', '$timeout', function($rootScope, $scope, dataService, $location, $timeout){ |
| 16 | $scope.dataService = dataService; |
| 17 | $scope.copySuccess = function (event) { |
| 18 | event.copied = true; |
| 19 | $timeout(function(){ |
| 20 | event.copied = false; |
| 21 | }, 5000); |
| 22 | }; |
| 23 | $scope.copyFailed = function (err) { |
| 24 | console.error('Error!', err); |
| 25 | }; |
Iftekharul Islam | f2d7464 | 2017-07-10 16:42:14 -0500 | [diff] [blame] | 26 | $scope.resolveEvent = function(event){ |
| 27 | APIUtils.resolveLogs([{Id: event.Id}]).then(function(){ |
| 28 | event.Resolved = 1; |
| 29 | }); |
| 30 | } |
| 31 | |
| 32 | $scope.accept = function(){ |
| 33 | $scope.event.selected = true; |
| 34 | $timeout(function(){ |
| 35 | $scope.$parent.accept(); |
| 36 | }, 10); |
| 37 | } |
Iftekharul Islam | 8b4828a | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 38 | }] |
| 39 | }; |
| 40 | }]); |
| 41 | })(window.angular); |