Is there an event for when an AUI dialog has loaded/displayed. I am wanting to execute some javascript after the dialog has displayed and the dialog elements are available. I am able to do this by adding a script tag in the template that is displayed in the dialog, but I thought there might be an event or a better approach. I saw the dialog 2 has a show event but it is still in an experimental state. Thanks!
Community moderators have prevented the ability to post new answers.
I was not able to get the "show.dialog" event to work. I'm probably doing something wrong. After doing some additional research I was able to get it to work (below) with info from:https://answers.atlassian.com/questions/58240/how-to-execute-javascript-in-popup-page
AJS.$(document).bind('dialogContentReady', function(event, dialog) { console.log('dialog shown'); });
Is there a downside to using this approach?
Here's a sample from the AUI.Dialog documentation at https://docs.atlassian.com/aui/latest/docs/dialog.html
AJS.bind("show.dialog", function(e, data) { console.log("Dialog shown " + data.dialog.id); });
There are events for show/hide/remove
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.