Move ohif:hotkeys into ohif:core
This commit is contained in:
parent
1abd0e6f9d
commit
184c959037
@ -1,5 +1,5 @@
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { HotkeysManager } from 'meteor/ohif:hotkeys/client/classes/HotkeysManager';
|
||||
import { HotkeysManager } from '/client/classes/HotkeysManager';
|
||||
import 'jquery.hotkeys';
|
||||
|
||||
// Create hotkeys namespace using a HotkeysManager class instance
|
||||
@ -12,3 +12,16 @@ if (Meteor.isDevelopment) {
|
||||
this.render('componentPlayground');
|
||||
});
|
||||
}
|
||||
|
||||
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();
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user