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 }, 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 }; 25 $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 } 37 }] 38 }; 39 }]); 40})(window.angular); 41