From 17d9161e186a1a095ee4aae23770aa784021c54a Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Sun, 13 Oct 2019 11:06:37 +0100 Subject: [PATCH] Hide hoverlink on command line open Inspired by VVimpulation - https://github.com/amedama41/vvimpulation/commit/53065d015d1e9a892496619b51be83771f57b3d5 Currently scrolls page to the bottom; should fix that before merging. --- src/content/commandline_content.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/content/commandline_content.ts b/src/content/commandline_content.ts index a4613d2c..dad3a706 100644 --- a/src/content/commandline_content.ts +++ b/src/content/commandline_content.ts @@ -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;`)