From cccd74c487286e995abb092153a8f0f715e529c3 Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Sun, 1 Jul 2007 11:04:02 +0000 Subject: [PATCH] autosize multiline widget --- chrome/content/vimperator/hints.js | 5 +++-- chrome/content/vimperator/ui.js | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/chrome/content/vimperator/hints.js b/chrome/content/vimperator/hints.js index 8c2ceb80..5e5c4dce 100644 --- a/chrome/content/vimperator/hints.js +++ b/chrome/content/vimperator/hints.js @@ -647,6 +647,7 @@ function Hints() //{{{ function initDoc(event) { + // vimperator.echo("Content loaded"); doc = event.originalTarget; genHintContainer(doc); isHahModeEnabled = false; @@ -676,10 +677,10 @@ function Hints() //{{{ createHints(); showHints(null, 0); } - //window.setTimeout("this.enableHahMode(HINT_MODE_ALWAYS);", 0); + // vimperator.echo("Done."); } - window.document.addEventListener("pageshow", initDoc, null); + window.document.addEventListener("DOMContentLoaded", initDoc, null); // FIXME: add resize support //window.addEventListener("resize", onResize, null); } //}}} diff --git a/chrome/content/vimperator/ui.js b/chrome/content/vimperator/ui.js index d02714bb..1226de6f 100644 --- a/chrome/content/vimperator/ui.js +++ b/chrome/content/vimperator/ui.js @@ -141,6 +141,9 @@ function CommandLine() //{{{ multiline_widget.collapsed = false; cmd = cmd.replace(/\n|\\n/g, "
") + "
Press ENTER or type command to continue"; multiline_widget.contentDocument.body.innerHTML = cmd; + + // size according to content -- TODO: if too large, leave a scrollbar) + multiline_widget.style.height = multiline_widget.contentDocument.height + "px"; } function addToHistory(str)