Have my popup shrink after it grows

0
I am building a project where a popup appears where a person can view and change their personal information. It has a static and an edit mode (different containers conditionally visible based on an attribute). When I go into edit mode the page becomes so massive that it grows vertically, and becomes able to scroll. (I am okay with this for now) However, once I close this edit mode, the page retains its new size, leaving a massive white space at the bottom of my popup. Is there a way to have my popup shrink automatically? (Or have it grow based on the height of it’s contents)
asked
1 answers
0

There are some stuff on dialog, which is probably available on all window widgets, e.g.

 

You’ll have to store the original size and then restore to it, test

 

//capture window
var dlg=dijit.byId('mxui_widget_DialogMessage_0')
//originals
var original_w=dlg.domNode.getBoundingClientRect().width;
var original_h=dlg.domNode.getBoundingClientRect().height;
//simulate resize (executed on conditional visibility)
dlg.resize(
   {
        t:0,
        l:0,
        w:dlg._getMaximumSize().w,
        h:dlg._getMaximumSize().h
   }
)
//simulate restore (executed on conditional visibility)
setTimeout(dojo.hitch(this,function(){
   dlg.resize(
      {
           t:0,
           l:0,
           h:original_h,
           w:original_w
      }
   )

}),1000);

 

answered