[DEV] remove a dependency
This commit is contained in:
parent
4a727f42e4
commit
22b349c0ca
@ -1,4 +1,4 @@
|
||||
<div class="popin">
|
||||
<div class="popin" *ngIf="displayPopIn">
|
||||
<div class="element {{popSize}}">
|
||||
<div class="header">
|
||||
<label class="unselectable">{{popTitle}}</label>
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user