1
0
-1

Hi,

Is there a way to reduce the minimum width below 668px for Jpopup? I want to use 300px but the popup with will resize back to 90% width if I use values under 668px.

 

This is my javascript code to create the popup

    var height = UI.getPopUpHeight("350");
    var width = UI.getPopUpWidth("670");

    JPopup.create("testPopup", "Add Item", width, height);

    JPopup.show("testPopup", "AddOrderItem?embed=true",params,"Add Item", width, height)

 

Thanks

    CommentAdd your comment...

    3 answers

    1.  
      1
      0
      -1

      Hi, i found the getPopupWidth implementation is as below. Then i tested with the following script seem ok.

       

      JPopup.show("testPopup", "http://localhost:8080/jw/web/userview/expenseclaim/home/_/a?",{},"Add Item", 670, 300);
      getPopUpWidth: function(width) {
             if (width === undefined || width === "") {
                 width = "90%";
             }
             var windowWidth = $(window).width();
             var minWidth = 668;
             var maxWidth = windowWidth - 100;
                 
             if (isNaN(width) && width.indexOf("%") !== -1) {
                 var tempWidth = parseFloat(width.replace("%", ""));
                 width = windowWidth * tempWidth / 100;
             }
             
             if (width > maxWidth) {
                 width = maxWidth;
             }
             
             if (width < minWidth) {
                 width = windowWidth;
             }
             
             return width;
         }
        CommentAdd your comment...
      1.  
        1
        0
        -1

        Yup, same outcome. 

          CommentAdd your comment...
        1.  
          1
          0
          -1

          Hi, did you try setting the width without calling the UI.getPopUpWidth function?

            CommentAdd your comment...