Browse Source

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

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

Loading…
Cancel
Save