Browse Source

fix: Necessary double button push for entering delete mode #173

master
Coin de Gamma 5 years ago
parent
commit
7b0a68d9fe
  1. 14
      src/panel/graph_panel/graph_ctrl.ts

14
src/panel/graph_panel/graph_ctrl.ts

@ -158,13 +158,19 @@ class GraphCtrl extends MetricsPanelCtrl {
}
bindDKey() {
this.keybindingSrv.bind('d', this.onDKey.bind(this));
rebindDKey() {
$(document).off('keydown.hasticDKey');
$(document).on('keydown.hasticDKey', (e) => {
// 68 is 'd' key kode
if(e.keyCode === 68) {
this.onDKey();
}
});
}
editPanel() {
super.editPanel();
this.bindDKey();
this.rebindDKey();
}
async getBackendURL(): Promise<string> {
@ -244,7 +250,7 @@ class GraphCtrl extends MetricsPanelCtrl {
this.analyticsController = new AnalyticController(this.panel, this.analyticService, this.events);
this.bindDKey();
this.rebindDKey();
this.events.on('render', this.onRender.bind(this));
this.events.on('data-received', this.onDataReceived.bind(this));

Loading…
Cancel
Save