Browse Source

Merge pull request #11682 from vvlladd28/bug/dashboard-layout/incorrect-show-widgets

Fixed incorrect show widgets in layout
pull/11704/head
Igor Kulikov 2 years ago
committed by GitHub
parent
commit
71bbd55f1f
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.html
  2. 4
      ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.ts
  3. 4
      ui-ngx/src/app/modules/home/models/dashboard-component.models.ts

2
ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.html

@ -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"

4
ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.ts

@ -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) => {

4
ui-ngx/src/app/modules/home/models/dashboard-component.models.ts

@ -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…
Cancel
Save