-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemp
48 lines (39 loc) · 1.38 KB
/
temp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
app.directive('ngCapture', ['$document', '$rootScope', '$interval', function($document, $rootScope, $interval) {
return {
link: function(scope) {
function onMouseUp(event) {
$rootScope.$broadcast('ngCapture.onMouseUp', {
event: event
});
}
function onMouseClick(event) {
$rootScope.$broadcast('ngCapture.onMouseClick', {
event: event
});
}
function onKeyUp(event) {
$rootScope.$broadcast('ngCapture.onKeyUp', {
event: event
});
}
function onKeyDown(event) {
$rootScope.$broadcast('ngCapture.onKeyDown', {
event: event
});
}
$interval(function() {
console.log('specialExtend');
onMouseUp(null)
}, 15000);
//Protection
$document.off('click', onMouseClick);
$document.off('keyup', onKeyUp);
$document.off('keydown', onKeyDown);
$document.off('mouseup', onMouseUp);
$document.on('click', onMouseClick);
$document.on('keyup', onKeyUp);
$document.on('keydown', onKeyDown);
$document.on('mouseup', onMouseUp);
}
};
}]);