OWL ITS + 탐지시스템(인터넷 진흥원)
jhjang
2021-10-14 b74776268dd3eb2bc57744928d6f7150ffcd4ec2
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
/**
 * Created by wisestone on 2017-12-21.
 */
'use strict';
 
define(['app'],
    function (app) {
        app.directive('jsShortCut', ["$rootScope", "$log",
            function ($rootScope, $log) {
                return {
                    scope : {
                      jsShortCutAction : "&"
                    },
                    restrict: 'A',
                    link: function (scope, element, attrs) {
 
 
                        $(document).unbind("keydown");
 
                        $(document).keydown(function (event) {
                            if (event.ctrlKey && event.key === 's') {
                                event.preventDefault();
 
                                if ($rootScope.isDefined(scope.jsShortCutAction)) {
                                    scope.jsShortCutAction();
                                }
                            }
                        });
                    }
                };
            }])
    });