From 46a83a4c7213177a10531dbf179a416a570dc466 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 7 Oct 2008 14:55:54 +0000 Subject: [PATCH] Resize the completion buffer on DOMSubtreeModified event --- content/ui.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/content/ui.js b/content/ui.js index c442f6b0..07d4b60e 100644 --- a/content/ui.js +++ b/content/ui.js @@ -1248,12 +1248,10 @@ liberator.ItemList = function (id) //{{{ return minHeight; } - var height = getHeight(); - if (height == 0) // sometimes we don't have the correct size at this point - setTimeout(function () { container.height = getHeight(); }, 10); - else - container.height = height; + if (completionElements) + container.height = getHeight(); } + doc.body.addEventListener("DOMSubtreeModified", autoSize, true); /** * uses the entries in completions to fill the listbox @@ -1308,12 +1306,10 @@ liberator.ItemList = function (id) //{{{ } let dom = liberator.util.xmlToDom(div, doc); - doc.body.appendChild(dom); - completionBody = dom.getElementsByTagName("tbody")[0]; completionElements = completionBody.childNodes; + doc.body.appendChild(dom); - autoSize(); } /////////////////////////////////////////////////////////////////////////////}}}