1

I have a BugMonkey script that applies Markdown formatting to my case events. However, when I edit an existing case event and click OK, the BugMonkey script does not apply the formatting. If I then Refresh the web page, it works as expected.

I found this answer BugMonkey won’t load in Edit mode and tried the suggestions but it does not seem to work with the Case Event Edit plugin. Is there a different event I should be hooking into besides 'BugViewChange'?

flag

1 Answer

2

I used the ajaxComplete event to do something similar. In the case of the Case Event Edit plugin, I think you should filter for the "_action=minimalUpdates" substring. Something like this:

$(document).ajaxComplete(function(e, xhr, settings) {
  if (settings.url.indexOf("_action=minimalUpdates") != -1)
    applyMarkdown();
});
link|flag
That did it! I got rid of the condition if (settings.url.indexOf("_action=minimalUpdates") != -1) because I want it to re-apply the markdown even if I don't make any changes to the case event. – mwolfe02 Sep 19 at 14:45
I posted my script in the [BugMonkey Script Archive](fogbugz.stackexchange.com/questions/59/…) but the code was apparently too long and got cut off. Is there a better place to post the source? – mwolfe02 Sep 19 at 15:00
@mwolfe02 but many other AJAX events will run! – Michel de Ruiter Sep 20 at 7:50

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.