fix(keyboardShortcuts) Fix the issue with Reset to Defaults for Keyboard Shortcuts. Fix typo for resetDefaults

This commit is contained in:
Aysel Afsar 2018-04-11 11:17:24 -04:00 committed by Erik Ziegler
parent e1cd01828a
commit 0c7edbe22e
2 changed files with 6 additions and 3 deletions

View File

@ -132,12 +132,12 @@ export class HotkeysManager {
delete this.defaults[contextName]; delete this.defaults[contextName];
} }
resetDefauls(contextName) { resetDefaults(contextName) {
const context = this.getContext(contextName); const context = this.getContext(contextName);
const definitions = this.defaults[contextName]; const definitions = this.defaults[contextName];
if (!context || !definitions) return; if (!context || !definitions) return;
context.extend(definitions); context.extend(definitions);
return this.store(contextName, definitions).then(this.changeObserver.changed); return this.store(contextName, definitions);
} }
switchToContext(contextName) { switchToContext(contextName) {

View File

@ -29,7 +29,10 @@ Template.hotkeysForm.onCreated(() => {
}; };
return OHIF.ui.showDialog('dialogConfirm', dialogOptions).then(() => { return OHIF.ui.showDialog('dialogConfirm', dialogOptions).then(() => {
return OHIF.hotkeys.resetDefauls(contextName); const resetDefaults = OHIF.hotkeys.resetDefaults(contextName);
resetDefaults.then(() => {
OHIF.hotkeys.load(contextName).then(defs => instance.hotkeysDefinitions.set(defs));
});
}); });
} }
}; };