azuremonitor: don't go back to dashboard if escape pressed in the editor

This commit is contained in:
Alexander Zobnin
2019-01-31 17:44:00 +03:00
parent 0c3657da7e
commit df9ecc6816
4 changed files with 36 additions and 1 deletions

View File

@@ -139,6 +139,10 @@ export class KeybindingSrv {
);
}
unbind(keyArg: string, keyType?: string) {
Mousetrap.unbind(keyArg, keyType);
}
showDashEditView() {
const search = _.extend(this.$location.search(), { editview: 'settings' });
this.$location.search(search);
@@ -293,3 +297,17 @@ export class KeybindingSrv {
}
coreModule.service('keybindingSrv', KeybindingSrv);
/**
* Code below exports the service to react components
*/
let singletonInstance: KeybindingSrv;
export function setKeybindingSrv(instance: KeybindingSrv) {
singletonInstance = instance;
}
export function getKeybindingSrv(): KeybindingSrv {
return singletonInstance;
}