Creating a hotkeys context for viewer
This commit is contained in:
1 parent
5e7edd91ee
commit
2f81c0e2e7
9 files changed
+53
-91
No files matched your search
@@ -0,0 +1 @@
|
||||
import './routes';
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Router } from 'meteor/iron:router';
|
||||
import { Session } from 'meteor/session';
|
||||
import { hotkeys } from 'meteor/ohif:hotkeys';
|
||||
|
||||
Router.onBeforeAction(function() {
|
||||
const lastRoute = Session.get('lastRoute');
|
||||
const currentRoute = this.router.current().route.getName();
|
||||
if (currentRoute !== lastRoute) {
|
||||
hotkeys.switchToContext(null);
|
||||
Session.set('lastRoute', currentRoute);
|
||||
}
|
||||
|
||||
this.next();
|
||||
});
|
||||
Reference in new issue
Block a user