import { Injectable } from '@angular/core'; @Injectable() export class DialogService { hasDialogOpened(tags?: string): boolean { let k = 0; let _tags = 'farris-dialog,.overlay-pane'; if (tags) { _tags += ',' + tags ; } const dlgs = window.document.querySelectorAll(_tags); const elements = Array.from(dlgs).filter(n => !Array.from(dlgs[0].classList).some(item => item == 'f-combo-list')); elements.forEach((n: any) => { let n1 = ''; if (n.tagName === 'DIV') { n1 = window.getComputedStyle(n).display; } else { n1 = window.getComputedStyle( n.querySelector('div')).display; } if (n1 === '' || n1 === 'block') { k++; } }); return k > 0; } }