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();
  • Possible duplicate of Can I control the way popups are created by $popup.create? – Pankaj Gaur Jan 22 '16 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. – Raúl Escudero Jan 24 '16 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. – Dylan .. Mark Saunders Jan 25 '16 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.