|
|
|
@ -91,6 +91,9 @@ export class DashboardComponent extends PageComponent implements IDashboardCompo |
|
|
|
@Input() |
|
|
|
margin: number; |
|
|
|
|
|
|
|
@Input() |
|
|
|
outerMargin: boolean; |
|
|
|
|
|
|
|
@Input() |
|
|
|
isEdit: boolean; |
|
|
|
|
|
|
|
@ -214,7 +217,7 @@ export class DashboardComponent extends PageComponent implements IDashboardCompo |
|
|
|
maxItemCols: 1000, |
|
|
|
maxItemRows: 1000, |
|
|
|
maxItemArea: 1000000, |
|
|
|
outerMargin: true, |
|
|
|
outerMargin: isDefined(this.outerMargin) ? this.outerMargin : true, |
|
|
|
margin: isDefined(this.margin) ? this.margin : 10, |
|
|
|
minItemCols: 1, |
|
|
|
minItemRows: 1, |
|
|
|
@ -270,7 +273,7 @@ export class DashboardComponent extends PageComponent implements IDashboardCompo |
|
|
|
if (!change.firstChange && change.currentValue !== change.previousValue) { |
|
|
|
if (['isMobile', 'isMobileDisabled', 'autofillHeight', 'mobileAutofillHeight', 'mobileRowHeight'].includes(propName)) { |
|
|
|
updateMobileOpts = true; |
|
|
|
} else if (['margin', 'columns'].includes(propName)) { |
|
|
|
} else if (['outerMargin', 'margin', 'columns'].includes(propName)) { |
|
|
|
updateLayoutOpts = true; |
|
|
|
} else if (propName === 'isEdit') { |
|
|
|
updateEditingOpts = true; |
|
|
|
@ -543,6 +546,7 @@ export class DashboardComponent extends PageComponent implements IDashboardCompo |
|
|
|
|
|
|
|
private updateLayoutOpts() { |
|
|
|
this.gridsterOpts.minCols = this.columns ? this.columns : 24; |
|
|
|
this.gridsterOpts.outerMargin = isDefined(this.outerMargin) ? this.outerMargin : true; |
|
|
|
this.gridsterOpts.margin = isDefined(this.margin) ? this.margin : 10; |
|
|
|
} |
|
|
|
|
|
|
|
@ -586,7 +590,8 @@ export class DashboardComponent extends PageComponent implements IDashboardCompo |
|
|
|
for (const widget of this.dashboardWidgets.dashboardWidgets) { |
|
|
|
totalRows += widget.rows; |
|
|
|
} |
|
|
|
rowHeight = (parentHeight - this.gridsterOpts.margin * (this.dashboardWidgets.dashboardWidgets.length + 2)) / totalRows; |
|
|
|
rowHeight = ( parentHeight - this.gridsterOpts.margin * |
|
|
|
( totalRows + (this.gridsterOpts.outerMargin ? 1 : -1) ) ) / totalRows; |
|
|
|
} |
|
|
|
} |
|
|
|
return rowHeight; |
|
|
|
|