Plugin Developer DiscussionDiscussion for FogBugz Plugin developers |
||
Sorry to be a pest today, but I have one more question.
Is there a way in BugEventDisplay to determine if the page the BugEvent is being displayed on is in read or edit mode? I'd like to conditionally alter the bugevent HTML, but not when the user is editing the bug.
Unfortunately this is not currently possible, because we don't re-render the bug events if you are viewing a bug and then hit "Edit" (we just swap some stuff out via Ajax).
This seems like a reasonable request and I've opened a case, but it would require changing the way the page is rendered and it's too close to release to do that.
Any suggestions on a reasonably solid interim workaround?
Perhaps some embedded JS that queries the state of some object in the DOM that is only visible in edit mode?
There's no method in the JavaScript API that would give you this information. If you want to try checking for the existence of some element in the DOM, I'd suggest the sEvent textarea. Using jQuery it'd look like this:
if ($("textarea[name=sEvent]").length > 0) { // edit mode } else { // view mode } Since this isn't supported in the API, there's no guarantee that it will work in future versions so you'll have to keep an eye out for any updates. |
Powered by FogBugz