|
|
|
@ -18,16 +18,20 @@ import { |
|
|
|
AfterViewInit, |
|
|
|
ChangeDetectionStrategy, |
|
|
|
ChangeDetectorRef, |
|
|
|
Component, ComponentRef, |
|
|
|
Component, |
|
|
|
ComponentRef, |
|
|
|
ElementRef, |
|
|
|
EventEmitter, |
|
|
|
HostBinding, |
|
|
|
Input, NgZone, OnChanges, |
|
|
|
Input, |
|
|
|
OnChanges, |
|
|
|
OnDestroy, |
|
|
|
OnInit, |
|
|
|
Output, |
|
|
|
Renderer2, SimpleChanges, |
|
|
|
ViewChild, ViewContainerRef, |
|
|
|
Renderer2, |
|
|
|
SimpleChanges, |
|
|
|
ViewChild, |
|
|
|
ViewContainerRef, |
|
|
|
ViewEncapsulation |
|
|
|
} from '@angular/core'; |
|
|
|
import { PageComponent } from '@shared/components/page.component'; |
|
|
|
@ -38,9 +42,9 @@ import { SafeStyle } from '@angular/platform-browser'; |
|
|
|
import { isNotEmptyStr } from '@core/utils'; |
|
|
|
import { GridsterItemComponent } from 'angular-gridster2'; |
|
|
|
import { UtilsService } from '@core/services/utils.service'; |
|
|
|
import ITooltipsterInstance = JQueryTooltipster.ITooltipsterInstance; |
|
|
|
import { from } from 'rxjs'; |
|
|
|
import { DashboardUtilsService } from '@core/services/dashboard-utils.service'; |
|
|
|
import ITooltipsterInstance = JQueryTooltipster.ITooltipsterInstance; |
|
|
|
|
|
|
|
export enum WidgetComponentActionType { |
|
|
|
MOUSE_DOWN, |
|
|
|
@ -134,8 +138,7 @@ export class WidgetContainerComponent extends PageComponent implements OnInit, O |
|
|
|
private renderer: Renderer2, |
|
|
|
private container: ViewContainerRef, |
|
|
|
private dashboardUtils: DashboardUtilsService, |
|
|
|
private utils: UtilsService, |
|
|
|
private zone: NgZone) { |
|
|
|
private utils: UtilsService) { |
|
|
|
super(store); |
|
|
|
} |
|
|
|
|
|
|
|
@ -307,26 +310,24 @@ export class WidgetContainerComponent extends PageComponent implements OnInit, O |
|
|
|
} |
|
|
|
}); |
|
|
|
this.editWidgetActionsTooltip = $(this.gridsterItem.el).tooltipster('instance'); |
|
|
|
this.zone.run(() => { |
|
|
|
componentRef = this.container.createComponent(EditWidgetActionsTooltipComponent); |
|
|
|
componentRef.instance.container = this; |
|
|
|
componentRef.instance.viewInited.subscribe(() => { |
|
|
|
if (this.editWidgetActionsTooltip.status().open) { |
|
|
|
this.editWidgetActionsTooltip.reposition(); |
|
|
|
} |
|
|
|
}); |
|
|
|
this.editWidgetActionsTooltip.on('destroyed', () => { |
|
|
|
componentRef.destroy(); |
|
|
|
}); |
|
|
|
const parentElement = componentRef.instance.element.nativeElement; |
|
|
|
const content = parentElement.firstChild; |
|
|
|
parentElement.removeChild(content); |
|
|
|
parentElement.style.display = 'none'; |
|
|
|
this.editWidgetActionsTooltip.content(content); |
|
|
|
this.updateEditWidgetActionsTooltipState(); |
|
|
|
this.widget.onSelected((selected) => |
|
|
|
this.updateEditWidgetActionsTooltipSelectedState(selected)); |
|
|
|
componentRef = this.container.createComponent(EditWidgetActionsTooltipComponent); |
|
|
|
componentRef.instance.container = this; |
|
|
|
componentRef.instance.viewInited.subscribe(() => { |
|
|
|
if (this.editWidgetActionsTooltip.status().open) { |
|
|
|
this.editWidgetActionsTooltip.reposition(); |
|
|
|
} |
|
|
|
}); |
|
|
|
this.editWidgetActionsTooltip.on('destroyed', () => { |
|
|
|
componentRef.destroy(); |
|
|
|
}); |
|
|
|
const parentElement = componentRef.instance.element.nativeElement; |
|
|
|
const content = parentElement.firstChild; |
|
|
|
parentElement.removeChild(content); |
|
|
|
parentElement.style.display = 'none'; |
|
|
|
this.editWidgetActionsTooltip.content(content); |
|
|
|
this.updateEditWidgetActionsTooltipState(); |
|
|
|
this.widget.onSelected((selected) => |
|
|
|
this.updateEditWidgetActionsTooltipSelectedState(selected)); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|