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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
7 additions and
3 deletions
-
ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.html
-
ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.ts
-
ui-ngx/src/app/modules/home/models/dashboard-component.models.ts
|
|
|
@ -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 { |
|
|
|
|