ngx-bootstrap
Version:
Native Angular Bootstrap Components
68 lines • 2.54 kB
JavaScript
import { Component, ElementRef, Renderer } from '@angular/core';
import { ClassName } from './modal-options.class';
import { isBs3 } from '../utils/ng2-bootstrap-config';
import { Utils } from '../utils/utils.class';
var ModalBackdropOptions = (function () {
function ModalBackdropOptions(options) {
this.animate = true;
Object.assign(this, options);
}
return ModalBackdropOptions;
}());
export { ModalBackdropOptions };
/** This component will be added as background layout for modals if enabled */
var ModalBackdropComponent = (function () {
function ModalBackdropComponent(element, renderer) {
this._isShown = false;
this.element = element;
this.renderer = renderer;
}
Object.defineProperty(ModalBackdropComponent.prototype, "isAnimated", {
get: function () {
return this._isAnimated;
},
set: function (value) {
this._isAnimated = value;
// this.renderer.setElementClass(this.element.nativeElement, `${ClassName.FADE}`, value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ModalBackdropComponent.prototype, "isShown", {
get: function () {
return this._isShown;
},
set: function (value) {
this._isShown = value;
this.renderer.setElementClass(this.element.nativeElement, "" + ClassName.IN, value);
if (!isBs3()) {
this.renderer.setElementClass(this.element.nativeElement, "" + ClassName.SHOW, value);
}
},
enumerable: true,
configurable: true
});
ModalBackdropComponent.prototype.ngOnInit = function () {
if (this.isAnimated) {
this.renderer.setElementClass(this.element.nativeElement, "" + ClassName.FADE, this.isAnimated);
Utils.reflow(this.element.nativeElement);
}
this.isShown = true;
};
ModalBackdropComponent.decorators = [
{ type: Component, args: [{
selector: 'bs-modal-backdrop',
template: '',
// tslint:disable-next-line
host: { 'class': ClassName.BACKDROP }
},] },
];
/** @nocollapse */
ModalBackdropComponent.ctorParameters = function () { return [
{ type: ElementRef, },
{ type: Renderer, },
]; };
return ModalBackdropComponent;
}());
export { ModalBackdropComponent };
//# sourceMappingURL=modal-backdrop.component.js.map