mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 00:17:58 +01:00
autosize multiline widget
This commit is contained in:
@@ -647,6 +647,7 @@ function Hints() //{{{
|
|||||||
|
|
||||||
function initDoc(event)
|
function initDoc(event)
|
||||||
{
|
{
|
||||||
|
// vimperator.echo("Content loaded");
|
||||||
doc = event.originalTarget;
|
doc = event.originalTarget;
|
||||||
genHintContainer(doc);
|
genHintContainer(doc);
|
||||||
isHahModeEnabled = false;
|
isHahModeEnabled = false;
|
||||||
@@ -676,10 +677,10 @@ function Hints() //{{{
|
|||||||
createHints();
|
createHints();
|
||||||
showHints(null, 0);
|
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
|
// FIXME: add resize support
|
||||||
//window.addEventListener("resize", onResize, null);
|
//window.addEventListener("resize", onResize, null);
|
||||||
} //}}}
|
} //}}}
|
||||||
|
|||||||
@@ -141,6 +141,9 @@ function CommandLine() //{{{
|
|||||||
multiline_widget.collapsed = false;
|
multiline_widget.collapsed = false;
|
||||||
cmd = cmd.replace(/\n|\\n/g, "<br/>") + "<br/><span style=\"color: green;\">Press ENTER or type command to continue</span>";
|
cmd = cmd.replace(/\n|\\n/g, "<br/>") + "<br/><span style=\"color: green;\">Press ENTER or type command to continue</span>";
|
||||||
multiline_widget.contentDocument.body.innerHTML = cmd;
|
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)
|
function addToHistory(str)
|
||||||
|
|||||||
Reference in New Issue
Block a user