Browse Source

fix: Null selected analytics unit after selection #174

master
Coin de Gamma 5 years ago
parent
commit
8789f155b8
  1. 3
      src/panel/graph_panel/graph_ctrl.ts
  2. 2
      src/panel/graph_panel/graph_renderer.ts

3
src/panel/graph_panel/graph_ctrl.ts

@ -250,7 +250,6 @@ 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.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));
@ -302,6 +301,8 @@ class GraphCtrl extends MetricsPanelCtrl {
onInitEditMode() { onInitEditMode() {
this.rebindDKey(); // a small hask: bind if we open page in edit mode
const partialPath = this.panelPath + '/partials'; const partialPath = this.panelPath + '/partials';
this.addEditorTab('Analytics', `${partialPath}/tab_analytics.html`, 2); this.addEditorTab('Analytics', `${partialPath}/tab_analytics.html`, 2);
this.addEditorTab('Webhooks', `${partialPath}/tab_webhooks.html`, 3); this.addEditorTab('Webhooks', `${partialPath}/tab_webhooks.html`, 3);

2
src/panel/graph_panel/graph_renderer.ts

@ -313,13 +313,11 @@ export class GraphRenderer {
// Function for rendering panel // Function for rendering panel
public renderPanel() { public renderPanel() {
this.panelWidth = this.$elem.width(); this.panelWidth = this.$elem.width();
if (this._shouldAbortRender()) { if (this._shouldAbortRender()) {
return; return;
} }
// un-check dashes if lines are unchecked // un-check dashes if lines are unchecked
this.panel.dashes = this.panel.lines ? this.panel.dashes : false; this.panel.dashes = this.panel.lines ? this.panel.dashes : false;

Loading…
Cancel
Save