UI: Fixed incorrect show widgets in layout
This commit is contained in:
parent
1f518cddbe
commit
c217769e96
@ -66,7 +66,7 @@
|
|||||||
</mat-menu>
|
</mat-menu>
|
||||||
<div [class]="dashboardClass" id="gridster-background">
|
<div [class]="dashboardClass" id="gridster-background">
|
||||||
<gridster #gridster id="gridster-child" [options]="gridsterOpts">
|
<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
|
<tb-widget-container
|
||||||
[gridsterItem]="gridsterItem"
|
[gridsterItem]="gridsterItem"
|
||||||
[widget]="widget"
|
[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) {
|
private scrollToWidget(widget: DashboardWidget, delay?: number) {
|
||||||
const parentElement = this.gridster.el as HTMLElement;
|
const parentElement = this.gridster.el as HTMLElement;
|
||||||
widget.gridsterItemComponent$().subscribe((gridsterItem) => {
|
widget.gridsterItemComponent$().subscribe((gridsterItem) => {
|
||||||
|
|||||||
@ -707,7 +707,7 @@ export class DashboardWidget implements GridsterItem, IDashboardWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set x(x: number) {
|
set x(x: number) {
|
||||||
if (!this.dashboard.isMobileSize) {
|
if (!this.dashboard.isMobileSize && this.dashboard.isEdit) {
|
||||||
if (this.widgetLayout) {
|
if (this.widgetLayout) {
|
||||||
this.widgetLayout.col = x;
|
this.widgetLayout.col = x;
|
||||||
} else {
|
} else {
|
||||||
@ -728,7 +728,7 @@ export class DashboardWidget implements GridsterItem, IDashboardWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set y(y: number) {
|
set y(y: number) {
|
||||||
if (!this.dashboard.isMobileSize) {
|
if (!this.dashboard.isMobileSize && this.dashboard.isEdit) {
|
||||||
if (this.widgetLayout) {
|
if (this.widgetLayout) {
|
||||||
this.widgetLayout.row = y;
|
this.widgetLayout.row = y;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user