Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 1 | import {Injectable} from "@angular/core"; |
| 2 | |
| 3 | @Injectable() |
| 4 | export class IframeService { |
| 5 | |
| 6 | addClassOpenModal(elementClassName: string) { |
| 7 | var parentBodyElement = parent.document.getElementsByClassName(elementClassName)[0]; |
| 8 | if (parentBodyElement) { |
| 9 | parentBodyElement.classList.add("modal-open"); |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | removeClassCloseModal(elementClassName: string) { |
| 14 | var parentBodyElement = parent.document.getElementsByClassName(elementClassName)[0]; |
| 15 | if (parentBodyElement) { |
| 16 | parentBodyElement.classList.remove("modal-open"); |
| 17 | } |
| 18 | } |
Ittay Stern | f792671 | 2019-07-07 19:23:03 +0300 | [diff] [blame] | 19 | |
| 20 | |
| 21 | addFullScreen(){ |
| 22 | let parentBodyElement = parent.document.getElementsByClassName('service-model-content')[0]; |
| 23 | if (parentBodyElement) { |
| 24 | parentBodyElement.classList.add("full-screen"); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | removeFullScreen(){ |
| 29 | let parentBodyElement = parent.document.getElementsByClassName('service-model-content')[0]; |
| 30 | if (parentBodyElement) { |
| 31 | parentBodyElement.classList.remove("full-screen"); |
| 32 | } |
| 33 | } |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 34 | } |