I have 2 buttons, each opening its own popup. When both popups are opened and the user clicks on the button for the popup in background, I want to focus on that one. The code for each popup is in a separate file (ExportCommand.js and ImportCommand.js). Relevant code bellow:
var c = this.properties;
if (c.popupImport && c.popupImport.isOpen()) {
c.popupImport.focus();
return;
}
var options = {
popupType: $popup.Type.SE_MODAL_IFRAME,
parentNode: view.getMainContentArea(),
overlayParentNode: view.getLayoutWrapper(),
pageId: pageId,
publicationId: publicationId
};
c.popupImport = $popup.create(url, features, options);
c.popupImport.open();