From b2aec82daf1933d93e38753d87b8f52d28c7631d Mon Sep 17 00:00:00 2001 From: Arild Matsson Date: Thu, 5 Dec 2024 12:29:35 +0100 Subject: [PATCH] fix: better width fallback for sidebar url ellipsis --- app/scripts/components/sidebar.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/scripts/components/sidebar.ts b/app/scripts/components/sidebar.ts index b527cc76..d301889d 100644 --- a/app/scripts/components/sidebar.ts +++ b/app/scripts/components/sidebar.ts @@ -405,7 +405,8 @@ angular.module("korpApp").component("sidebar", { .find(".sidebar_url") .css("white-space", "nowrap") .each(function () { - const totalWidth = $(this).parent().width() || 0 + // TODO This happens before sidebar is actually showing, so parent width is 0 the first time + const totalWidth = $(this).parent().width() || 240 // Drop the scheme part ("https://") let text = $(this) .text()