Title: obj.onPopState handler
Last modified: May 14, 2021

---

# obj.onPopState handler

 *  Resolved [Andrew Leonard](https://wordpress.org/support/users/andrewleonard/)
 * (@andrewleonard)
 * [5 years ago](https://wordpress.org/support/topic/obj-onpopstate-handler/)
 * There is a problem with your code and `Simple Lightbox’ plugin Version 2.8.1,
   By Archetyped
    I have discussed this with them and they think it is your problem
   I have a solution for it but it means ediiting your code every time you have 
   an update This is the code I add:
 *     ```
       Add the following code into The Event Calendar's obj.onPopState handler
       wp-content/plugins/the-events-calendar/src/resources/js/views/manager.js
       starting line 372
   
       	    /* START add this code AL 20210203 */
       	    var stateViewer = event.originalEvent.state.viewer;
       	    if ( stateViewer == "slb_default") {
       			return false;
       		}
       	    /* END add this code AL 20210203 */
       ```
   
 * It would be nice for me if you could sort this out
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fobj-onpopstate-handler%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [highprrrr](https://wordpress.org/support/users/highprrrr/)
 * (@highprrrr)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/obj-onpopstate-handler/#post-14554835)
 * Hi there!
 * Can you tell me what your problem was that this code is fixing?
 * Thanks!
 *  Thread Starter [Andrew Leonard](https://wordpress.org/support/users/andrewleonard/)
 * (@andrewleonard)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/obj-onpopstate-handler/#post-14555067)
 * I have the EC “Events List” widgets in my primary sidebar.
    This used to go “
   screwy” after I clicked on an image that openned up with the lightbox effect.
   The lightbox plugin is “Simple Lightbox” Version 2.8.1 by Archetyped I asked 
   them and they said it was your code that was causing the problem My very clever
   friend said that I needed to add the code above to the obj.onPopState handler
   I don’t know but I think this code has been amended by EC now to prevent this
   happenning My fix is not in your code and the problem no longer exist If you 
   wanted to see it I would have to goback to a previous version of TEC If you tell
   me what code to remove from the obj.onPopState handler, I would oblige
 *  [highprrrr](https://wordpress.org/support/users/highprrrr/)
 * (@highprrrr)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/obj-onpopstate-handler/#post-14555389)
 * That won’t be necessary. I’m glad the issue is no longer present, apologies for
   the delayed response.
 * Have a great week!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘obj.onPopState handler’ is closed to new replies.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [highprrrr](https://wordpress.org/support/users/highprrrr/)
 * Last activity: [4 years, 12 months ago](https://wordpress.org/support/topic/obj-onpopstate-handler/#post-14555389)
 * Status: resolved