t3brightside / microtemplate

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

Popup is not closed in Firefox browser #15

Open bergischweb opened 3 months ago

bergischweb commented 3 months 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 3 months 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 3 months 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()
//}
t3brightside commented 1 month ago

Hey, @bergischweb there's more to that. Containeritems popups can be opened in multiple amount. Using back button supposed to close opened popups one by one.

Anyway, there's an improved script in ext:containeritems dev version now, where the open popups are tracked using js variable.