blob: e85823986d38ba6ba8276e1322c9396d4d7b36fe [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',
Ed Tanousbbcf6702017-10-06 13:53:06 -07009 'template': require('./log-event.html'),
Iftekharul Islam8b4828a2017-04-19 14:37:55 -050010 'scope': {
11 'event': '=',
Iftekharul Islam96bbf312017-08-22 13:44:38 -050012 'tmz': '=',
13 'multiSelected': '='
Iftekharul Islam8b4828a2017-04-19 14:37:55 -050014 },
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 Islamf2d74642017-07-10 16:42:14 -050026 $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 Islam8b4828a2017-04-19 14:37:55 -050038 }]
39 };
40 }]);
41})(window.angular);