Closed sleemanj closed 4 years ago
gocher commented:
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?
Mokhet commented:
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
@sleemanj commented:
Committed some changes in changeset:446
@sleemanj changed milestone to Version 1.0
gocher commented:
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](../commit/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"; head.appendChild(link); } window.dialogArguments = opener.Dialog._arguments; var body = document.body; if(win_dim) { window.resizeTo(win_dim.width, win_dim.height); if(win_dim.top && win_dim.left) { window.moveTo(win_dim.left,win_dim.top); } else { var x = opener.screenX + (opener.outerWidth - win_dim.width) / 2; var y = opener.screenY + (opener.outerHeight - win_dim.height) / 2; window.moveTo(x,y); } } else if (window.sizeToContent) { window.moveTo(0,0); window.resizeTo(screen.availWidth,screen.availHeight); 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; else 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 { window.moveTo(0,0); window.resizeTo(screen.availWidth,10); 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) window.resizeTo(body.offsetWidth,screen.availHeight-50); // 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; }
wymsy commented:
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;
to
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?
wymsy commented:
Of course, I meant makes it work in standards mode as well....
koto commented:
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)
@sleemanj commented:
888
@sleemanj commented:
318
@sleemanj commented:
461
I hope changeset:740 fixes this at last, regardless of doctype and if MS decides decides to add anymore useless bars to popup windows
Developers: You have to define the width of the popup by resizing the window to an appropriate value ''before'' calling __dlg_init()
fixed
new
to closed
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.
Reported by anonymous, migrated from http://trac.xinha.org/ticket/603