moraes
21 Dec 2006, 9:49 AM
Anybody have tried to change a BasicDialog size to the viewport size and perhaps add a 'maximize' button in the upper right corner, together with the close button? I've played with it for a while copying some code from LayoutManager:
fullScreen : function(){
var size = this.getViewSize();
this.xy = [0, 0];
this.resizeTo(size.width, size.height);
this.refreshSize();
},
getViewSize : function(){
var size = {width: YAHOO.util.Dom.getViewportWidth(), height: YAHOO.util.Dom.getViewportHeight()};
size.width -= this.el.getBorderWidth('lr')-this.el.getPadding('lr');
size.height -= this.el.getBorderWidth('tb')-this.el.getPadding('tb');
return size;
},
It's not perfect at all, there are horizontal/vertical scrolls, but it's a beginning. Any tips to improve this?
fullScreen : function(){
var size = this.getViewSize();
this.xy = [0, 0];
this.resizeTo(size.width, size.height);
this.refreshSize();
},
getViewSize : function(){
var size = {width: YAHOO.util.Dom.getViewportWidth(), height: YAHOO.util.Dom.getViewportHeight()};
size.width -= this.el.getBorderWidth('lr')-this.el.getPadding('lr');
size.height -= this.el.getBorderWidth('tb')-this.el.getPadding('tb');
return size;
},
It's not perfect at all, there are horizontal/vertical scrolls, but it's a beginning. Any tips to improve this?