onKeyDown function listener

This commit is contained in:
Guillaume Wuip 2014-12-15 22:02:11 +01:00
parent 82b494a7b2
commit 830ffa134e
2 changed files with 7 additions and 1 deletions

View file

@ -17,7 +17,7 @@
</head> </head>
<body ng-keydown="sidebar = $event.keyCode == 27 ? false : sidebar"> <body ng-keydown="onKeyDown">
<header class="header"> <header class="header">

View file

@ -222,6 +222,12 @@
} }
}; };
$rootScope.onKeyDown = function ($event) {
if ($event.keyCode == 27) {
$rootScope.sidebar = false
}
}
} }
]); ]);