Hide hoverlink on command line open

Inspired by VVimpulation - 53065d015d

Currently scrolls page to the bottom; should fix that before merging.
This commit is contained in:
Oliver Blanthorn 2019-10-13 11:06:37 +01:00
parent 8628eb78f1
commit 17d9161e18
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -58,6 +58,18 @@ init().catch(e => {
export function show() {
try {
cmdline_iframe.classList.remove("hidden")
/* Hide "hoverlink" pop-up which obscures command line
*
* Inspired by VVimpulation: https://github.com/amedama41/vvimpulation/commit/53065d015d1e9a892496619b51be83771f57b3d5
*
* Known issue: currently scrolls the page to the bottom.
*/
const a = window.document.createElement("A")
; (a as any).href = "#"
document.body.appendChild(a)
a.focus()
document.body.removeChild(a)
const height =
cmdline_iframe.contentWindow.document.body.offsetHeight + "px"
cmdline_iframe.setAttribute("style", `height: ${height} !important;`)