From 032929d287cbafefe8367e0fcee18dec4b1bf9f7 Mon Sep 17 00:00:00 2001 From: vempo Date: Mon, 22 Oct 2018 11:33:19 +0300 Subject: Deleted deprecated workflow project Change-Id: I2ad75adab7d47d8df5b3996a315a9b173fa4bbfe Issue-ID: SDC-1855 Signed-off-by: vempo --- .../src/app/paletx/util/popup.ts | 59 ---------------------- 1 file changed, 59 deletions(-) delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/paletx/util/popup.ts (limited to 'deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/paletx/util/popup.ts') diff --git a/deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/paletx/util/popup.ts b/deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/paletx/util/popup.ts deleted file mode 100644 index dacbc0b9..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-ui/src/app/paletx/util/popup.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { - Injector, - TemplateRef, - ViewRef, - ViewContainerRef, - Renderer, - ComponentRef, - ComponentFactory, - ComponentFactoryResolver -} from '@angular/core'; - -export class ContentRef { - constructor(public nodes: any[], public viewRef?: ViewRef, public componentRef?: ComponentRef) { - } -} - -export class PopupService { - private _windowFactory: ComponentFactory; - private _windowRef: ComponentRef; - private _contentRef: ContentRef; - - constructor(type: any, private _injector: Injector, private _viewContainerRef: ViewContainerRef, private _renderer: Renderer, - componentFactoryResolver: ComponentFactoryResolver) { - this._windowFactory = componentFactoryResolver.resolveComponentFactory(type); - } - - public open(content?: string | TemplateRef, context?: any): ComponentRef { - if (!this._windowRef) { - this._contentRef = this._getContentRef(content, context); - this._windowRef = - this._viewContainerRef.createComponent(this._windowFactory, 0, this._injector, this._contentRef.nodes); - } - - return this._windowRef; - } - - public close() { - if (this._windowRef) { - this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._windowRef.hostView)); - this._windowRef = null; - - if (this._contentRef.viewRef) { - this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._contentRef.viewRef)); - this._contentRef = null; - } - } - } - - private _getContentRef(content: string | TemplateRef, context?: any): ContentRef { - if (!content) { - return new ContentRef([]); - } else if (content instanceof TemplateRef) { - const viewRef = this._viewContainerRef.createEmbeddedView(>content, context); - return new ContentRef([viewRef.rootNodes], viewRef); - } else { - return new ContentRef([[this._renderer.createText(null, `${content}`)]]); - } - } -} -- cgit 1.2.3-korg