blob: ae4970dd306d3400a7f2666ae5b97aca9ae9116d [file] [log] [blame]
Iftekharul Islam8b4828a2017-04-19 14:37:55 -05001window.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',
9 'templateUrl': 'common/directives/log-event.html',
10 'scope': {
11 'event': '=',
12 'tmz': '='
13 },
14 'controller': ['$rootScope', '$scope','dataService', '$location', '$timeout', function($rootScope, $scope, dataService, $location, $timeout){
15 $scope.dataService = dataService;
16 $scope.copySuccess = function (event) {
17 event.copied = true;
18 $timeout(function(){
19 event.copied = false;
20 }, 5000);
21 };
22 $scope.copyFailed = function (err) {
23 console.error('Error!', err);
24 };
Iftekharul Islamf2d74642017-07-10 16:42:14 -050025 $scope.resolveEvent = function(event){
26 APIUtils.resolveLogs([{Id: event.Id}]).then(function(){
27 event.Resolved = 1;
28 });
29 }
30
31 $scope.accept = function(){
32 $scope.event.selected = true;
33 $timeout(function(){
34 $scope.$parent.accept();
35 }, 10);
36 }
Iftekharul Islam8b4828a2017-04-19 14:37:55 -050037 }]
38 };
39 }]);
40})(window.angular);