[DEV] remove a dependency

This commit is contained in:
Edouard DUPIN 2020-10-25 14:24:38 +01:00
parent 4a727f42e4
commit 22b349c0ca
2 changed files with 12 additions and 12 deletions

View File

@ -1,4 +1,4 @@
<div class="popin">
<div class="popin" *ngIf="displayPopIn">
<div class="element {{popSize}}">
<div class="header">
<label class="unselectable">{{popTitle}}</label>

View File

@ -4,8 +4,7 @@
* @license MPL-2 (see license file)
*/
import { Component, ElementRef, Input, Output, OnInit, OnDestroy, EventEmitter} from '@angular/core';
import * as $ from 'jquery';
import { Component, Input, Output, OnInit, OnDestroy, EventEmitter} from '@angular/core';
import { PopInService } from '../../service/popin';
@ -17,6 +16,7 @@ import { PopInService } from '../../service/popin';
})
export class PopInComponent implements OnInit, OnDestroy {
public displayPopIn: boolean = false;
@Input() id: string;
@Input() popTitle: string = 'No title';
@Input() closeTopRight: any = "false";
@ -28,10 +28,8 @@ export class PopInComponent implements OnInit, OnDestroy {
@Input() saveTitle: any = null;
@Input() otherTitle: any = null;
private element: any;
constructor(private popInService: PopInService,
private el: ElementRef) {
this.element = $(el.nativeElement);
constructor(private popInService: PopInService) {
}
ngOnInit(): void {
// ensure id attribute exists
@ -40,22 +38,24 @@ export class PopInComponent implements OnInit, OnDestroy {
return;
}
// move element to bottom of page (just before </body>) so it can be displayed above everything else
this.element.appendTo('body');
//this.element.appendTo('body');
this.popInService.add(this);
this.element.hide();
//this.element.hide();
}
// remove self from popIn service when directive is destroyed
ngOnDestroy(): void {
this.popInService.remove(this.id);
this.element.remove();
//this.element.remove();
}
// open popIn
open(): void {
this.element.show();
this.displayPopIn = true;
//this.element.show();
}
// close popin
close(): void {
this.element.hide();
this.displayPopIn = false;
//this.element.hide();
}
onCloseTop(): void {