mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
dashlist: fix panel resizing
This commit is contained in:
parent
84b277d5c0
commit
06622088a1
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user