t3brightside / microtemplate

TYPO3 CMS template extension – one pager with light box like sub pages.
https://microtemplate.t3brightside.com
GNU General Public License v2.0
14 stars 5 forks source link

Popup is not closed in Firefox browser #15

Open bergischweb opened 1 month ago

bergischweb commented 1 month ago

In Firefox browser the popups for dataprotection and imprint (#c329 and #c379) are not closed. There seems to be a problem with 'history.back()'. It is possible to close the popup with the browser back button though.

The popup for '/features' though is closed as expected.

t3brightside commented 1 month ago

Thanks for reporting @bergischweb, indeed seems to be a problem with ext:containeritems At this point no idea when can I have time to look into it.

bergischweb commented 1 month ago

As a workaround, I de-activated some lines of code in function 'cPopupCloseTopmost()' where the history.back() call happens. Thus i rely only on function 'cPopupClose(topMostPopup)' to close the popup - which works like a charm.

if(openerLink) {
    openerLink.focus();
    openerLink.removeAttribute('id')
}
// deactivated because not working in Firefox browser
//const openedFromLink = history.state && history.state.endsWith(`#${popupId}`);
//if( openedFromLink ) {
     //    history.back();
//}
//else {
    cPopupClose(topMostPopup);
    const subpageUrl = window.location.pathname + window.location.search;
    history.replaceState(subpageUrl,'',subpageUrl);
    cPopupResumeDocumentBody()
//}