Opened 15 years ago

Closed 14 years ago

#603 closed defect (fixed)

Popop Dialog Height

Reported by: anonymous Owned by: gogo
Priority: normal Milestone: Version 1.0
Component: Xinha Core Version:
Severity: normal Keywords:


on nearly all popup dialogs, the height is too short such that the statusbar panel covers the buttons at the bottom. I'm sure there's an offset value someplace that would fix this globally but I can't find it.

Change History (12)

comment:1 Changed 15 years ago by gocher

I think that is a Problem with floating elements!
The window.sizeToContent() don't works correct with it. My way to change it is to set a window.resizeTo(x, y) at the end of the init function of each popup! But may be there is a better way?

comment:2 Changed 15 years ago by Mokhet

I think it's related to ticket #318. Mister anonymous can you confirm your browser and OS ? "Nearly all" is too vague imho, can you please give 2 example of correct height and 2 examples of wrong one ? Thank

comment:3 Changed 15 years ago by gogo

Committed some changes in changeset:446

comment:4 Changed 15 years ago by gogo

  • Milestone set to Version 1.0

comment:5 Changed 15 years ago by gocher

in my CMS I use that dlg_init function in popup.js :

function __dlg_init(bottom, win_dim) {
  if(window.__dlg_init_done) return true;

  if(window.opener._editor_skin != "") {
    var head = document.getElementsByTagName("head")[0];
    var link = document.createElement("link");
    link.type = "text/css";
    link.href = window.opener._editor_url + 'skins/' + window.opener._editor_skin + '/skin.css';
    link.rel = "stylesheet";
	window.dialogArguments = opener.Dialog._arguments;

  var body        = document.body;

    window.resizeTo(win_dim.width, win_dim.height);
    if( && win_dim.left)
      var x = opener.screenX + (opener.outerWidth - win_dim.width) / 2;
      var y = opener.screenY + (opener.outerHeight - win_dim.height) / 2;
  else if (window.sizeToContent) {
		window.addEventListener("unload", __dlg_onclose, true);
		if (body.offsetHeight+50>opener.outerHeight){
			if (body.offsetHeight+50>screen.availHeight)
				window.innerHeight = screen.availHeight-50;
				wimdow.innerHeight = body.offsetHeight + 5;
			// center on screen
			var x = (screen.availWidth - window.outerWidth) / 2;;
			var y = (screen.availHeight - window.outerHeight) / 2;
		} else {
			window.innerHeight = body.offsetHeight + 5;
			// center on parent
			var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
			var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
		window.moveTo(x, y);
	} else {
		var height = body.offsetHeight;
		window.resizeTo(10,body.scrollHeight + height);
		var width = body.offsetWidth;
		window.resizeBy((body.scrollWidth - width), 0);
		window.resizeBy(20,0); //scrollbar
		if (body.offsetHeight+50>screen.availHeight)
		// center on screen
		var x = (screen.availWidth - body.offsetWidth) / 2;
		var y = (screen.availHeight - body.offsetHeight) / 2;
		window.moveTo(x, y);
	HTMLArea.addDom0Event(document.body, 'keypress', __dlg_close_on_esc);
  window.__dlg_init_done = true;

comment:6 Changed 14 years ago by wymsy

Gogo's changes in changeset:446 appear to fix the problem, at least in quirks mode. Changing line 81 from

		var body_height = body.scrollHeight;


		var body_height = docElm && docElm.scrollTop ? docElm.scrollHeight : body.scrollHeight;

makes it work in quirks mode as well (see ticket #318). I'll commit this change under ticket #318, but I think this ticket can be closed. Does anyone disagree?

comment:7 Changed 14 years ago by wymsy

Of course, I meant makes it work in standards mode as well....

comment:8 Changed 14 years ago by koto

I added HTML 4.01 Transitional doctypes to plugins code on my local copy to toggle standards mode in IE and still the popup dimensions have to be different for IE/Firefox (Firefox's statusbar covers the bottom of the popups)

comment:9 Changed 14 years ago by gogo

comment:10 Changed 14 years ago by gogo

comment:11 Changed 14 years ago by gogo

comment:12 Changed 14 years ago by ray

  • Resolution set to fixed
  • Status changed from new to closed

I hope changeset:740 fixes this at last, regardless of doctype and if MS decides decides to add anymore useless bars to popup windows

You have to define the width of the popup by resizing the window to an appropriate value before calling dlg_init()

Note: See TracTickets for help on using tickets.