workaround for bug 227951: add bookmarks dialog grows everytime the expander is clicked.

Use of resizeTo instead of sizeToContent (buggy on Windows)


git-svn-id: svn://10.0.0.236/trunk@150593 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
chanial%noos.fr 2003-12-21 04:09:02 +00:00
parent b728971073
commit ecd4f52cfb

View File

@ -78,6 +78,10 @@ var gMenulist;
var gBookmarksTree;
var gGroup;
# on windows, sizeToContent is buggy (see bug 227951), we''ll use resizeTo
# instead and cache the bookmarks tree view size.
var WSucks;
function Startup()
{
sizeToContent(); //XXXpch buggy imo, we shouldn't need it
@ -95,6 +99,11 @@ function Startup()
gSelectedFolder = RDF.GetResource(gMenulist.selectedItem.id);
gExpander.setAttribute("tooltiptext", gExpander.getAttribute("tooltiptextdown"));
# read the persisted attribute. If it is not present, set a default height.
WSucks = parseInt(gBookmarksTree.getAttribute("height"));
if (!WSucks)
WSucks = 150;
// fix no more persisted class attribute in old profiles
var localStore = RDF.GetDataSource("rdf:local-store");
var rAttribute = RDF.GetResource("class");
@ -210,9 +219,10 @@ function expandTree()
var willCollapse = !gBookmarksTree.collapsed;
gExpander.setAttribute("class",willCollapse?"down":"up");
gExpander.setAttribute("tooltiptext", gExpander.getAttribute("tooltiptext"+(willCollapse?"down":"up")));
if (willCollapse)
if (willCollapse) {
document.documentElement.buttons = "accept,cancel";
else {
WSucks = gBookmarksTree.boxObject.height;
} else {
document.documentElement.buttons = "accept,cancel,extra2";
# always open the bookmark root folder
if (!gBookmarksTree.treeBoxObject.view.isContainerOpen(0))
@ -221,7 +231,7 @@ function expandTree()
gBookmarksTree.focus();
}
gBookmarksTree.collapsed = willCollapse;
sizeToContent();
resizeTo(window.outerWidth, window.outerHeight+(willCollapse?-WSucks:+WSucks));
}
function setFolderTreeHeight()