November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi,
When editor is logged to edit mode then window object contains "epi" property.
So maybe using:
if (window.epi) { // turn of functionality }
could help to solve your problem.
Hi,
Now I think that maybe a better aproach would be to use "EPiServer.Editor.PageEditing.PageIsInEditMode" value. In previous solution the Javascript checking would be executed every time even if you are not in edit mode. So I think that it will be better to prepare a server condition:
@if (EPiServer.Editor.PageEditing.PageIsInEditMode == false) { <script type="text/javascript"> // run custom renderring </script> }
Now when the page will be renderred in view mode there will be no exra JS condition.
And also when you use window.epi then it's easy to guess that this is based on EPiServer. In the second solution this information is not available.
Hi!
I've run into a little problem. I would need to disable a surtain line of Javascript only when a user is in edit mode. It has to do with web browser size and page reloads... Is there a way to find out if a user is in edit mode with/from Javascript? If so I see a good chance of fixing this. Thankful for help!