PDA

View Full Version : Viewport sized dialogs



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?

Animal
22 Dec 2006, 12:34 AM
I believe adding a parent Element to BasicDialog is on Jack's list. I think the feature could be helped by input from the forum.

I'd imagine that with a parent Element available, then it could be constrained to the bounds of that element, and also have a maximize button to expand to fill that element.

It could also have a minimize button if an animateTarget were specified in the config so that it could minimize to something.

I played with something like this: http://www.yui-ext.com/forum/viewtopic.php?t=885

Topper
3 Sep 2007, 7:01 AM
This works great. The next step should be expanding the contents inside the Dialog (for example a ContentPanel with a form).

Regards
Topper