Popup resize for different screens

I have used os-internal-ui-dialog style for popup resize in main module style sheet but it is applied to all popups and there are many popups in a screen for different different screens. I want to resize popup according to each screen content. Please help! 

Hi,

The popup editor widget allows you to define the size of the popup for each popup.

Nuno Rolo wrote:

Hi,

The popup editor widget allows you to define the size of the popup for each popup.


I tried it but it's not working in my case. And there are many screens for popup so it is not feasible to give size for every popup. 

But for you to achieve this you can't have the size forced in your main theme. 

And if you take a good look into the widget there's an AutoResize property, you don't need to define the size in every popup it normally adjusts the size to the content. The known limitation is to decrease the size of popup that's already opened.

Nuno Rolo wrote:

But for you to achieve this you can't have the size forced in your main theme. 

And if you take a good look into the widget there's an AutoResize property, you don't need to define the size in every popup it normally adjusts the size to the content. The known limitation is to decrease the size of popup that's already opened.


I want increased size of popup than which came normally by popup. Can i increase popup size than the normal with fit content using popup editor's property? 

As I said if you don't define a size in the widget's property it will adjust the size to the content it has. 

If you see that sometimes it doesn't adjust well you can provide the desired size in those properties.

Nuno, probably the popup should have some button that expands and collapses, increase the popup size, when the popup collapses, looks strange.

Shweta Gedam wrote:

I have used os-internal-ui-dialog style for popup resize in main module style sheet but it is applied to all popups and there are many popups in a screen for different different screens. I want to resize popup according to each screen content. Please help! 


Hello Shweta,

If you are setting the height and width can you please remove that and set AutoResize to true.

I tried it but it takes the normal size, I want bigger size than the normal one. Also the popup properties not working in my case.


Hello Shweta,

You set the height and width to the popup. So popup used that height and width.
If you want minimum width, can you apply the css to popup with minimum width and minimum height.

Please try with this.


.os-internal-ui-dialog.os-internal-ui-widget.os-internal-ui-widget-content.os-internal-ui-corner-all.os-internal-Popup.os-internal-ui-draggable{
 min-width: 950px;
 min-height: 600px;
}

Shweta Gedam wrote:

I have used os-internal-ui-dialog style for popup resize in main module style sheet but it is applied to all popups and there are many popups in a screen for different different screens. I want to resize popup according to each screen content. Please help! 

Hi Shweta Gedam!

I had the same problem, and i solved with the use of  PopupEditor_forceResize() function used in all of refreshed screen action's at the end of flow's through the RunJavaScript() function of HTTPRequestHandler library and in the end of Preparation flow too.





SyntaxEditor Code Snippet

function PopupEditor_ForceResize() {
    
    var PopUpFrame = window.self.frameElement;
    var PopUpDocument = window.self.document;
    var popupDiv = PopUpFrame.parentElement;
    var popupDivOldHeight = popupDiv.style.height;
    // reduce iframe's div height to its contents
     popupDiv.style.height=PopUpDocument.body.clientHeight+"px";
    // pop-up editor already auto-grows, so we just need to address auto-shrink
    if (popupDiv.height() >= popupDivOldHeight) {
        return false;
    }
    var result = window.self.RichWidgets_Popup_Editor_resize(popupDiv, -1, -1, false, {target: popupDiv});
    if (!result) {
        // something wrong happened in resize - reset iframe's div height
        popupDiv.height(popupDivOldHeight);
    }
}

You have to put this script in the option javascript of your popup.

And in your popup_editor you have to remove the WidthPx and HeightPx Attributes and set the option AutoResize to "True".

I hope it help you!


Best Regards,

Nuno Pereira