Scroll event in preview mode

Vote:
 

I'm currently lazy-loading some content using a JS scroll event. Although in preview mode this event does never fire. I've figured as much that it's bound to the wrong element. I've tried disabling lazy-loading using the "if(window.epi)" solution for JS without any luck.
I've also looked at work-arounds for the server-side "EPiServer.Editor.PageEditing.PageIsInEditMode" for blocks without any luck. The best shot was using the viewbag in the previewcontroller but for some reason my previewcontroller is never hit, only the specified block controller.

Any hint or nudge in the correct direction would be much appreciated.

#182420
Sep 18, 2017 17:12
Vote:
 

For anyone interested in a solution i solved it using "if(window.parent.epi)", afternoon brain did not think of this. If I stumble uppon a more neat solution I'll update this post :)

#182433
Sep 19, 2017 9:00
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.