blob: ab93d1ac83c2f2b0ce8392c8ef675a3997844d26 [file] [log] [blame]
import {Injectable} from "@angular/core";
import {DialogService} from "ng2-bootstrap-modal";
@Injectable()
export class IframeService {
addClassOpenModal(elementClassName: string) {
const parentBodyElement = parent.document.getElementsByClassName(elementClassName)[0];
if (parentBodyElement) {
parentBodyElement.classList.add("modal-open");
}
}
removeClassCloseModal(elementClassName: string) {
const parentBodyElement = parent.document.getElementsByClassName(elementClassName)[0];
if (parentBodyElement) {
parentBodyElement.classList.remove("modal-open");
}
}
closeIframe(dialogService : DialogService, that){
this.removeClassCloseModal('content');
dialogService.removeDialog(that);
setTimeout(() => {
window.parent.postMessage("closeIframe", "*");
}, 15);
}
addFullScreen(){
let parentBodyElement = parent.document.getElementsByClassName('service-model-content')[0];
if (parentBodyElement) {
parentBodyElement.classList.add("full-screen");
}
}
removeFullScreen(){
let parentBodyElement = parent.document.getElementsByClassName('service-model-content')[0];
if (parentBodyElement) {
parentBodyElement.classList.remove("full-screen");
}
}
}