diff options
author | vempo <vitaliy.emporopulo@amdocs.com> | 2018-07-24 17:34:04 +0300 |
---|---|---|
committer | vempo <vitaliy.emporopulo@amdocs.com> | 2018-07-25 11:39:10 +0300 |
commit | a52d50e788792a63e97a9176ab319d53db7a2853 (patch) | |
tree | b1c2222cacf4b8192aea16d1e0315b1f005c5347 /sdc-workflow-designer-ui/src/app/paletx/plx-modal/modal-window.ts | |
parent | 3c2665debb400aef7f0ed9e235698d2ff9f859db (diff) |
Replaced old implementation at root
Old project files and directories has been moved
under 'deprecated-workflow-designer'. The old project
is not built by the CI anymore, but can be still built manually.
New modules/directories have been moved up and integrated with
the CI system.
Change-Id: I1528c792bcbcce9e50bfc294a1328a20e72c91cf
Issue-ID: SDC-1559
Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/paletx/plx-modal/modal-window.ts')
-rw-r--r-- | sdc-workflow-designer-ui/src/app/paletx/plx-modal/modal-window.ts | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/sdc-workflow-designer-ui/src/app/paletx/plx-modal/modal-window.ts b/sdc-workflow-designer-ui/src/app/paletx/plx-modal/modal-window.ts deleted file mode 100644 index eda5b39f..00000000 --- a/sdc-workflow-designer-ui/src/app/paletx/plx-modal/modal-window.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { - Component, - Output, - EventEmitter, - Input, - ElementRef, - Renderer, - OnInit, - AfterViewInit, - OnDestroy, ViewEncapsulation -} from '@angular/core'; - -import {ModalDismissReasons} from './modal-dismiss-reasons'; - -@Component({ - selector: 'plx-modal-window', - host: { - '[class]': '"modal plx-modal fade show" + (windowClass ? " " + windowClass : "")', - 'role': 'dialog', - 'tabindex': '-1', - 'style': 'display: block;', - '(keyup.esc)': 'escKey($event)', - '(click)': 'backdropClick($event)' - }, - template: ` - <div [class]="'modal-dialog' + (size ? ' modal-' + size : '')" role="document"> - <div class="modal-content"><ng-content></ng-content></div> - </div> - `, - styleUrls: ['modal.less'], - encapsulation: ViewEncapsulation.None -}) -export class PlxModalWindow implements OnInit, AfterViewInit, OnDestroy { - private _elWithFocus: Element; // element that is focused prior to modal opening - - @Input() public backdrop: boolean | string = true; - @Input() public keyboard = true; - @Input() public size: string; - @Input() public windowClass: string; - - @Output('dismiss') public dismissEvent = new EventEmitter(); - - constructor(private _elRef: ElementRef, private _renderer: Renderer) { - } - - public backdropClick($event): void { - if (this.backdrop === true && this._elRef.nativeElement === $event.target) { - this.dismiss(ModalDismissReasons.BACKDROP_CLICK); - } - } - - public escKey($event): void { - if (this.keyboard && !$event.defaultPrevented) { - this.dismiss(ModalDismissReasons.ESC); - } - } - - public dismiss(reason): void { - this.dismissEvent.emit(reason); - } - - public ngOnInit() { - this._elWithFocus = document.activeElement; - this._renderer.setElementClass(document.body, 'modal-open', true); - } - - public ngAfterViewInit() { - if (!this._elRef.nativeElement.contains(document.activeElement)) { - this._renderer.invokeElementMethod(this._elRef.nativeElement, 'focus', []); - } - } - - public ngOnDestroy() { - if (this._elWithFocus && document.body.contains(this._elWithFocus)) { - this._renderer.invokeElementMethod(this._elWithFocus, 'focus', []); - } else { - this._renderer.invokeElementMethod(document.body, 'focus', []); - } - this._elWithFocus = null; - this._renderer.setElementClass(document.body, 'modal-open', false); - } -} |