浏览器窗口大小发生变化时,让弹出的窗体自动居间

浏览器窗口大小发生变化时,让弹出的窗体自动居中

//浏览器窗口大小发生变化时,让弹出的窗体自动居中
Ext.EventManager.onWindowResize (function(){
    if(addServerInfoWindow){
         addServerInfoWindow.setHeight(document.body.clientHeight/1.5);
        addServerInfoWindow.setWidth(document.body.clientWidth/3);
        addServerInfoWindow.center();
    }
   
    if(updateServerInfoWindow){
         updateServerInfoWindow.setHeight(document.body.clientHeight/1.5);
        updateServerInfoWindow.setWidth(document.body.clientWidth/3);
        updateServerInfoWindow.center();
    }
});