mirror of
https://github.com/mathew-kurian/Scribe.js
synced 2025-04-24 22:34:58 +00:00
Listen on keydown in app.run() in order to avoid $digest repetitions
This commit is contained in:
parent
830ffa134e
commit
a23fb326d6
2 changed files with 7 additions and 5 deletions
|
@ -17,7 +17,7 @@
|
|||
|
||||
</head>
|
||||
|
||||
<body ng-keydown="onKeyDown">
|
||||
<body>
|
||||
|
||||
<header class="header">
|
||||
|
||||
|
|
|
@ -98,8 +98,9 @@
|
|||
'$location',
|
||||
'$q',
|
||||
'$window',
|
||||
'$document',
|
||||
'ScribeAPI',
|
||||
function ($rootScope, $location, $q, $window, ScribeAPI) {
|
||||
function ($rootScope, $location, $q, $window, $document, ScribeAPI) {
|
||||
|
||||
/**
|
||||
* getAllLogsFiles
|
||||
|
@ -222,11 +223,12 @@
|
|||
}
|
||||
};
|
||||
|
||||
$rootScope.onKeyDown = function ($event) {
|
||||
$document.bind('keydown', function ($event) {
|
||||
if ($event.keyCode == 27) {
|
||||
$rootScope.sidebar = false
|
||||
$rootScope.sidebar = false;
|
||||
$rootScope.$digest()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
]);
|
||||
|
|
Loading…
Add table
Reference in a new issue