1

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();
3
  • Possible duplicate of Can I control the way popups are created by $popup.create? Jan 22, 2016 at 14:24
  • I don't know if it is a problem of cache, but if you have defined both popups with diferent names, that solution must work. I have tried and it works for me. Try changing the popup options. Jan 24, 2016 at 21:24
  • Is the issue happening when one of the popups is already opened and you reselect it? If this is the case you probable need to add the c.popupImport.focus() JS to force it back into the forefront. Jan 25, 2016 at 15:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.