Commit e89e64e9 by Alexander Zobnin

dashlist: fix resizing after mode switching

parent 7d8b2cb0
...@@ -32,8 +32,10 @@ class DashListCtrl extends PanelCtrl { ...@@ -32,8 +32,10 @@ class DashListCtrl extends PanelCtrl {
} }
this.events.on('refresh', this.onRefresh.bind(this)); this.events.on('refresh', this.onRefresh.bind(this));
this.events.on('panel-size-changed', this.onPanelSizeChanged.bind(this));
this.events.on('init-edit-mode', this.onInitEditMode.bind(this)); this.events.on('init-edit-mode', this.onInitEditMode.bind(this));
this.events.on('render', this.setPanelHeight.bind(this));
this.events.on('panel-size-changed', this.setPanelHeight.bind(this));
this.events.on('panel-change-view', this.setPanelHeight.bind(this));
this.groups = [ this.groups = [
{list: [], show: false, header: "Starred dashboards",}, {list: [], show: false, header: "Starred dashboards",},
...@@ -59,8 +61,6 @@ class DashListCtrl extends PanelCtrl { ...@@ -59,8 +61,6 @@ class DashListCtrl extends PanelCtrl {
} }
delete this.panel.mode; delete this.panel.mode;
} }
console.log(this);
} }
onInitEditMode() { onInitEditMode() {
...@@ -69,17 +69,12 @@ class DashListCtrl extends PanelCtrl { ...@@ -69,17 +69,12 @@ class DashListCtrl extends PanelCtrl {
this.addEditorTab('Options', 'public/app/plugins/panel/dashlist/editor.html'); this.addEditorTab('Options', 'public/app/plugins/panel/dashlist/editor.html');
} }
onPanelSizeChanged() {
this.setPanelHeight();
}
setPanelHeight() { setPanelHeight() {
this.$scope.setPanelHeight(); this.$scope.setPanelHeight();
} }
link(scope, elem, attrs, ctrl: DashListCtrl) { link(scope, elem, attrs, ctrl: DashListCtrl) {
let panelContentElem = elem.find('.panel-content'); let panelContentElem = elem.find('.panel-content');
console.log(elem, panelContentElem);
panelContentElem.height(ctrl.height); panelContentElem.height(ctrl.height);
scope.setPanelHeight = () => { scope.setPanelHeight = () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment