Browse Source

UI: Fix widget edit actions tooltip position.

pull/11484/head
Igor Kulikov 2 years ago
parent
commit
a88840cdb5
  1. 2
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html
  2. 2
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts
  3. 1
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.models.ts
  4. 1
      ui-ngx/src/app/modules/home/components/widget/widget-container.component.scss
  5. 6
      ui-ngx/src/app/modules/home/components/widget/widget-container.component.ts
  6. 4
      ui-ngx/src/app/modules/home/models/widget-component.models.ts

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

@ -277,7 +277,7 @@
'tb-dashboard-toolbar-animated': isToolbarOpenedAnimate,
'tb-dashboard-toolbar-closed': !toolbarOpened }">
<mat-drawer-container hasBackdrop="false" class="tb-absolute-fill tb-dashboard-drawer-container">
<mat-drawer-content fxLayout="column" fxLayoutAlign="center start">
<mat-drawer-content #dashboardContent fxLayout="column" fxLayoutAlign="center start">
<section *ngIf="!widgetEditMode" class="tb-dashboard-title"
[ngStyle]="{'color': dashboard.configuration.settings.titleColor}">
<h3 [fxShow]="!isEdit && displayTitle()">{{ translatedDashboardTitle }}</h3>

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

@ -222,6 +222,8 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
@ViewChild('dashboardContainer') dashboardContainer: ElementRef<HTMLElement>;
@ViewChild('dashboardContent', {read: ElementRef}) dashboardContent: ElementRef<HTMLElement>;
prevDashboard: Dashboard;
iframeMode = this.utils.iframeMode;

1
ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.models.ts

@ -56,6 +56,7 @@ export interface DashboardContext {
export interface IDashboardController {
dashboardCtx: DashboardContext;
dashboardContainer: ElementRef;
dashboardContent: ElementRef;
elRef: ElementRef;
openRightLayout();
openDashboardState(stateId: string, openRightLayout: boolean);

1
ui-ngx/src/app/modules/home/components/widget/widget-container.component.scss

@ -173,6 +173,7 @@ gridster-item:hover {
}
.tooltipster-sidetip.tb-widget-edit-actions-tooltip {
position: absolute !important;
.tooltipster-box {
user-select: none;
background: #fff;

6
ui-ngx/src/app/modules/home/components/widget/widget-container.component.ts

@ -148,9 +148,9 @@ export class WidgetContainerComponent extends PageComponent implements OnInit, O
$(this.gridsterItem.el).on('mousedown', (e) => this.onMouseDown(e.originalEvent));
$(this.gridsterItem.el).on('click', (e) => this.onClicked(e.originalEvent));
$(this.gridsterItem.el).on('contextmenu', (e) => this.onContextMenu(e.originalEvent));
const dashboardElement = this.widget.widgetContext.dashboardPageElement;
if (dashboardElement) {
this.initEditWidgetActionTooltip(dashboardElement);
const dashboardContentElement = this.widget.widgetContext.dashboardContentElement;
if (dashboardContentElement) {
this.initEditWidgetActionTooltip(dashboardContentElement);
}
}

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

@ -184,6 +184,10 @@ export class WidgetContext {
return this.dashboard?.stateController?.dashboardCtrl?.elRef?.nativeElement;
}
get dashboardContentElement(): HTMLElement {
return this.dashboard?.stateController?.dashboardCtrl?.dashboardContent?.nativeElement;
}
authService: AuthService;
deviceService: DeviceService;
assetService: AssetService;

Loading…
Cancel
Save