Strange behavior when replacing AimeosPage.onHideOffscreen

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
loeffe1
Posts: 52
Joined: 21 Feb 2020, 10:33

Strange behavior when replacing AimeosPage.onHideOffscreen

Post by loeffe1 » 05 May 2023, 07:54

If I replace this function within $(function() { } in my custom js, it is not executed at all. If I replace it not nested, it is executed twice. Why is this happening?

Code: Select all

AimeosPage.onHideOffscreen = function() {
  $('.aimeos-overlay-offscreen').on('click', () => {
    console.log("click")
    $('.aimeos-overlay-offscreen').removeClass('show');
    $('.zeynep.opened').removeClass('opened');
  });
}
click will not be logged if this block is nested within $(function() { } and will be logged twice if not nested

User avatar
aimeos
Administrator
Posts: 7884
Joined: 01 Jan 1970, 00:00

Re: Strange behavior when replacing AimeosPage.onHideOffscreen

Post by aimeos » 07 May 2023, 11:53

loeffe1 wrote: 05 May 2023, 07:54

Code: Select all

AimeosPage.onHideOffscreen = function() {
  $('.aimeos-overlay-offscreen').on('click', () => {
    console.log("click")
    $('.aimeos-overlay-offscreen').removeClass('show');
    $('.zeynep.opened').removeClass('opened');
  });
}
The code seems to be correct. Is your custom.js file included after the aimeos.js file?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
loeffe1
Posts: 52
Joined: 21 Feb 2020, 10:33

Re: Strange behavior when replacing AimeosPage.onHideOffscreen

Post by loeffe1 » 09 May 2023, 10:01

Yes it is.

Post Reply