Add temporary url parameter
This commit is contained in:
committed by
Torkel Ödegaard
parent
338a37abc8
commit
63fa9fdc6d
@@ -63,32 +63,24 @@ export class DashboardCtrl implements PanelContainer {
|
|||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.dashboard = dashboard;
|
this.dashboard = dashboard;
|
||||||
this.dashboard.processRepeats();
|
this.dashboard.processRepeats();
|
||||||
console.log(this.dashboard.panels);
|
|
||||||
|
|
||||||
let maxRows = Math.max(
|
if (window.location.search.search('autofitpanels') !== -1) {
|
||||||
...this.dashboard.panels.map(panel => {
|
let maxRows = Math.max(
|
||||||
return panel.gridPos.h + panel.gridPos.y;
|
...this.dashboard.panels.map(panel => {
|
||||||
})
|
return panel.gridPos.h + panel.gridPos.y;
|
||||||
);
|
})
|
||||||
console.log('maxRows: ' + maxRows);
|
);
|
||||||
//Consider navbar and submenu controls, padding and margin
|
|
||||||
let availableHeight = window.innerHeight - 80;
|
|
||||||
let availableRows = Math.floor(availableHeight / (GRID_CELL_HEIGHT + GRID_CELL_VMARGIN));
|
|
||||||
|
|
||||||
console.log('availableRows: ' + availableRows);
|
//Consider navbar and submenu controls, padding and margin
|
||||||
let scaleFactor = maxRows / availableRows;
|
let availableHeight = window.innerHeight - 80;
|
||||||
console.log(scaleFactor);
|
let availableRows = Math.floor(availableHeight / (GRID_CELL_HEIGHT + GRID_CELL_VMARGIN));
|
||||||
|
let scaleFactor = maxRows / availableRows;
|
||||||
|
|
||||||
this.dashboard.panels.forEach((panel, i) => {
|
this.dashboard.panels.forEach((panel, i) => {
|
||||||
console.log(i);
|
panel.gridPos.y = Math.round(panel.gridPos.y / scaleFactor) || 1;
|
||||||
console.log(panel.gridPos);
|
panel.gridPos.h = Math.round(panel.gridPos.h / scaleFactor) || 1;
|
||||||
panel.gridPos.y = Math.round(panel.gridPos.y / scaleFactor) || 1;
|
});
|
||||||
panel.gridPos.h = Math.round(panel.gridPos.h / scaleFactor) || 1;
|
}
|
||||||
|
|
||||||
console.log(panel.gridPos);
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(this.dashboard.panels);
|
|
||||||
|
|
||||||
this.unsavedChangesSrv.init(dashboard, this.$scope);
|
this.unsavedChangesSrv.init(dashboard, this.$scope);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user