Changes by Farcasi Alexandru-Vicentiu on 15/Sep/26 13:52
Summary:
Javascript event for when the macro modal is opened or a parameter is loaded
1 comment
Farcasi Alexandru-Vicentiu on 15/Sep/26 13:52
Hello Manuel Leduc! The underlying issue is about executing JavaScript code at the exact moment a parameter is displayed. Right now there are a few cases that need to be considered: when the modal opens for the first time, when it is closed, and when it is reopened immediately afterward. In jQuery, the code needs to run both when the script initializes and when the modal opens, since it's not always clear when the input actually becomes visible. Also, on newer versions, the "shown.bs.modal" event stopped being reliable because the input wasn't yet visible by the time the event fired, so a MutationObserver had to be used instead to detect when the input actually became visible. AFAIK you can find an example of the problem here: https://github.com/xwikisas/project-management/blob/59a0a64120034fa56e366301a55fda9e9bc763a6/project-management-openproject/project-management-openproject-macro/src/main/resources/openproject/js/projectSelect.js#L143
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.