1window.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                   'multiSelected': '='
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                    };
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                    }
38                }]
39            };
40        }]);
41})(window.angular);
42