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