Move ohif:hotkeys into ohif:core

This commit is contained in:
Erik Ziegler 2018-09-17 11:19:06 +02:00
parent 1abd0e6f9d
commit 184c959037
10 changed files with 14 additions and 1 deletions

View File

@ -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

View File

@ -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();
});