UI: Fixed incorrect show widgets in layout
This commit is contained in:
parent
1f518cddbe
commit
c217769e96
@ -66,7 +66,7 @@
|
||||
</mat-menu>
|
||||
<div [class]="dashboardClass" id="gridster-background">
|
||||
<gridster #gridster id="gridster-child" [options]="gridsterOpts">
|
||||
<gridster-item #gridsterItem [item]="widget" [class]="{'tb-noselect': isEdit}" *ngFor="let widget of dashboardWidgets">
|
||||
<gridster-item #gridsterItem [item]="widget" [class]="{'tb-noselect': isEdit}" *ngFor="let widget of dashboardWidgets; trackBy: trackByWidgetId">
|
||||
<tb-widget-container
|
||||
[gridsterItem]="gridsterItem"
|
||||
[widget]="widget"
|
||||
|
||||
@ -558,6 +558,10 @@ export class DashboardComponent extends PageComponent implements IDashboardCompo
|
||||
}
|
||||
}
|
||||
|
||||
public trackByWidgetId(_index: number, widget: DashboardWidget) {
|
||||
return widget.widgetId;
|
||||
}
|
||||
|
||||
private scrollToWidget(widget: DashboardWidget, delay?: number) {
|
||||
const parentElement = this.gridster.el as HTMLElement;
|
||||
widget.gridsterItemComponent$().subscribe((gridsterItem) => {
|
||||
|
||||
@ -707,7 +707,7 @@ export class DashboardWidget implements GridsterItem, IDashboardWidget {
|
||||
}
|
||||
|
||||
set x(x: number) {
|
||||
if (!this.dashboard.isMobileSize) {
|
||||
if (!this.dashboard.isMobileSize && this.dashboard.isEdit) {
|
||||
if (this.widgetLayout) {
|
||||
this.widgetLayout.col = x;
|
||||
} else {
|
||||
@ -728,7 +728,7 @@ export class DashboardWidget implements GridsterItem, IDashboardWidget {
|
||||
}
|
||||
|
||||
set y(y: number) {
|
||||
if (!this.dashboard.isMobileSize) {
|
||||
if (!this.dashboard.isMobileSize && this.dashboard.isEdit) {
|
||||
if (this.widgetLayout) {
|
||||
this.widgetLayout.row = y;
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user