Skip to content

Commit

Permalink
Expand tab preview panel width for custom tooltip text
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Nov 29, 2024
1 parent 84d1b50 commit 3ee2f35
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion webextensions/resources/tab-preview-frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,16 @@ try{
font: Message-Box;
left: auto;
max-width: var(--panel-width);
min-width: var(--panel-width);
opacity: 0;
overflow: hidden; /* clip the preview with the rounded edges */
padding: var(--panel-border-radius) 0 0;
position: fixed;
right: auto;
transition: var(--show-hide-animation);
width: var(--panel-width);
}
.tab-preview-panel.extended {
max-width: min(100%, calc(var(--panel-width) * 2));
}
.tab-preview-panel.open {
opacity: 1;
Expand Down Expand Up @@ -296,18 +299,21 @@ function updatePanel({ tabId, title, url, tooltipText, hasPreview, previewURL, t
urlElement.classList.add('hidden');
tooltipTextElement.textContent = tooltipText;
tooltipTextElement.classList.remove('hidden');
panel.classList.add('extended');
}
else {
tooltipTextElement.classList.add('hidden');
titleElement.textContent = title;
titleElement.classList.remove('hidden');
urlElement.classList.remove('hidden');
panel.classList.remove('extended');
}
} else if (typeof title == 'string') {
tooltipTextElement.classList.add('hidden');
titleElement.textContent = title;
titleElement.classList.remove('hidden');
urlElement.classList.remove('hidden');
panel.classList.remove('extended');
}

if (typeof url == 'string') {
Expand Down

0 comments on commit 3ee2f35

Please sign in to comment.