I've written some javascript that does a bunch of asynchronous API calls to display third-party content on the current page.
(I also do this as a way of displaying confluence content instead of using the content macros, because too many content macros on one pages slows the page load enough for users to start complaining; asynchronous loads provide a better user experience.)
This works fine, except that if I click the 'Edit' button, I have to wait while all the javascript re-runs (i.e. creates the view mode again*) before the page even tries to switch to edit mode.
*I presume this always happens when switching any page into edit mode, but we don't normally notice it?
Is there any way to stop the javascript running on this pre-edit page view load? Something wrapped around my code that says "if edit button has been clicked, abort"?
(I don't have access to create plug-ins etc btw - only front-end javascript)
PS - we have collaborative editing enabled
Looks from there event checker will help
https://developer.atlassian.com/cloud/confluence/jsapi/confluence/
e.g. it helps to me
Thanks for this link (I'm using Confluence server btw).
I wasn't sure how I would have implemented this for my scenario:
I have a page in Confluence containing an HTML macro. In that page I can either write some javascript or link to an javascript file attached to the page. My js is doing ajax calls.
Update: as far as I can see this is no longer an issue.
Which might be since the upgrade to Confluence 7.3.1 (or an earlier version and I didn't realise this had resolved itsself as I have added buttons to 'run javascript' to most of my stuff now).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.