So I have a custom field that comes with some JS magic to show additional information. This JS magic, however, is completely dysfunctional after a user cancels the inline editing of my custom field. How can I re-attach my event handlers since JIRA.Events.NEW_CONTENT_ADDED
does not seem to get fired when the editor is removed from the page?
Community moderators have prevented the ability to post new answers.
After debugging myself through JIRA's inline editing capabilities I finally found an event to hook into: BEFORE_INLINE_EDIT_CANCEL
!
Since, as the name suggests, it is however called before the inline editing is canceled (and therefore before the view's "saved" HTML is put back in place where the editor resided), one needs to do a timeout hack to actually run custom code in time:
JIRA.bind(JIRA.Events.BEFORE_INLINE_EDIT_CANCEL, function (e1, ctx) { window.setTimeout(rebindEventHandlers, 100); });
I wish this (and many other JIRA.Events
) would be better documented - right now I can only find documentation for NEW_CONTENT_ADDED
- and I wish Atlassian would introduce some INLINE_EDIT_CANCELED
or alike event that runs after the view HTML has been put back in place.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.