Mon. - Fri. 9 am - 5 pm Ask a Question
Remember me

Clicking "back" after opening the lightbox

6 years 9 months ago #1

  • Aaron's Avatar
  • Aaron
We're getting a problem where if you open an image in the lightbox and close out of it, when you press the back button to go to your previous page, it's reopening the lightbox and making it impossible to navigate back.

Is there a way we can stop this from happening? It's making the navigation very hard on the site we're currently building that it using the gallery.

Here is a link if you need to see it in action:
79.170.44.121/dressini.com/index.php/mother-of-the-bride

Click on one of the buttons under the images (eg: Cabotine), then scroll down to the bottom of the new page and open the gallery in a lightbox. Then close it and try to go back to the page you started on.

6 years 9 months ago #2

  • Artem's Avatar
  • Artem
  • Posts: 11281
Hello,

it's not the bug, it's a Browser History. Each image in lightbox and category has own url. We can not ignore the browser history. Here is can be only one solution, remove unique URL's for Images and categories,

Go to: components >> com_bagallery >> assets >> js >> ba-gallery.js
Find and Remove all lines with: window.history.pushState

Regards,

6 years 9 months ago #3

  • Aaron's Avatar
  • Aaron
Thank you, this will work for us. :)

6 years 9 months ago #4

  • Artem's Avatar
  • Artem
  • Posts: 11281
You're welcome :)

Regards,

6 years 9 months ago #5

  • Michael Beardsley's Avatar
  • Michael Beardsley
Hi, I was searching the forum for this very subject. I'm wondering if you might consider adding this as a future update. I plan on using this component (which I LOVE) on numerous future sights. Not sure I understand the logic of lightbox popping back up when hitting back button. Also, when I hit back button repeatedly, I can't back out of the lightbox. The same lightbox image keeps loading.

Thank you, Mike

6 years 9 months ago #6

  • Artem's Avatar
  • Artem
  • Posts: 11281
Hi Mike,

Why we didn't add this feature as an option?! Because Social Sharing will not work, each image in the lightbox should have unique URL

Regards,

6 years 9 months ago #7

  • Michael Beardsley's Avatar
  • Michael Beardsley
Ah, I see. Thank you for your response.

So if I follow your instructions, Find and "Remove all lines with: window.history.pushState", that will eliminate social sharing ability?

regards, m

6 years 9 months ago #8

  • Artem's Avatar
  • Artem
  • Posts: 11281
Yes, absolutely right. For Social Sharing Image in the Lightbox should have unique URL, but in the same way, to fix problem with "Clicking Back" we need to remove this URL, because it's going to the browser History and we can't ignore or avoid Browser History

6 years 9 months ago #9

  • Michael Beardsley's Avatar
  • Michael Beardsley
Thank you, m
Powered by Kunena Forum