Commit 06622088 by Alexander Zobnin

dashlist: fix panel resizing

parent 84b277d5
......@@ -32,6 +32,7 @@ class DashListCtrl extends PanelCtrl {
}
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.groups = [
......@@ -58,6 +59,8 @@ class DashListCtrl extends PanelCtrl {
}
delete this.panel.mode;
}
console.log(this);
}
onInitEditMode() {
......@@ -66,6 +69,24 @@ class DashListCtrl extends PanelCtrl {
this.addEditorTab('Options', 'public/app/plugins/panel/dashlist/editor.html');
}
onPanelSizeChanged() {
this.setPanelHeight();
}
setPanelHeight() {
this.$scope.setPanelHeight();
}
link(scope, elem, attrs, ctrl: DashListCtrl) {
let panelContentElem = elem.find('.panel-content');
console.log(elem, panelContentElem);
panelContentElem.height(ctrl.height);
scope.setPanelHeight = () => {
panelContentElem.height(ctrl.height);
};
}
onRefresh() {
var promises = [];
......@@ -74,7 +95,10 @@ class DashListCtrl extends PanelCtrl {
promises.push(this.getSearch());
return Promise.all(promises)
.then(this.renderingCompleted.bind(this));
.then(() => {
this.setPanelHeight();
return this.renderingCompleted();
});
}
getSearch() {
......
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