diff options
author | Daniel Carl <danielcarl@gmx.de> | 2021-01-25 22:23:55 +0100 |
---|---|---|
committer | Daniel Carl <danielcarl@gmx.de> | 2021-01-25 22:25:50 +0100 |
commit | 1255049e514dadfc151713b5f0b93e00ad5f3db2 (patch) | |
tree | 5df98456c05394aeda27ec1c7938c7afff5b162e | |
parent | a8d61308e84f3c6de09ab7ea426563674c25d561 (diff) |
Do not fail in hinting if element clientRects could not be found.
Fixes #659
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | src/scripts/hints.js | 9 |
2 files changed, 7 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index cc93dd9..9eafcfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. * Fixed crash in normal_focus_last_active (Thanks to Maxime Coste) * Fixed hint keys going to webview if the hinted element had no src-attribut (thanks to Maxime Coste) +* Fixed erro in hinting on gitlab which caused the hints to have ho labels #659. ### Removed * Expansion of `%` to the current opened URI for `:shellcmd` was removed because it breaks the `x-hint-command` with URIs containing '%'. But it is diff --git a/src/scripts/hints.js b/src/scripts/hints.js index fab48de..8917632 100644 --- a/src/scripts/hints.js +++ b/src/scripts/hints.js @@ -168,16 +168,19 @@ var hints = Object.freeze((function(){ continue; } - count++; - - /* create the hint label with number/letters */ rect = e.getClientRects()[0]; + if (!rect) { + continue; + } + + count++; label = labelTmpl.cloneNode(false); label.style.display = "none"; label.style.left = Math.max(rect.left - 4, 0) + "px"; label.style.top = Math.max(rect.top - 4, 0) + "px"; + /* create the hint label with number/letters */ /* if hinted element is an image - show title or alt of the image in hint label */ /* this allows to see how to filter for the image */ text = ""; |