Add automatic native titles to all truncateable elements
This commit is contained in:
parent
a4840c7365
commit
ab6ae15836
10 changed files with 27 additions and 20 deletions
|
|
@ -619,6 +619,20 @@ function setupClocks() {
|
|||
updateClocks();
|
||||
}
|
||||
|
||||
function setupTruncatedElementTitles() {
|
||||
const elements = document.querySelectorAll(".text-truncate, .single-line-titles .title, .text-truncate-2-lines, .text-truncate-3-lines");
|
||||
|
||||
if (elements.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
const element = elements[i];
|
||||
console.log(element.title);
|
||||
if (element.title === "") element.title = element.textContent;
|
||||
}
|
||||
}
|
||||
|
||||
async function setupPage() {
|
||||
const pageElement = document.getElementById("page");
|
||||
const pageContentElement = document.getElementById("page-content");
|
||||
|
|
@ -644,6 +658,10 @@ async function setupPage() {
|
|||
contentReadyCallbacks[i]();
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
setupTruncatedElementTitles();
|
||||
}, 50);
|
||||
|
||||
setTimeout(() => {
|
||||
document.body.classList.add("page-columns-transitioned");
|
||||
}, 300);
|
||||
|
|
|
|||
|
|
@ -931,17 +931,6 @@ details[open] .summary::after {
|
|||
border-radius: var(--border-radius) var(--border-radius) 0 0;
|
||||
}
|
||||
|
||||
.video-title {
|
||||
margin-bottom: auto;
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
text-overflow: ellipsis;
|
||||
line-clamp: 2;
|
||||
-webkit-line-clamp: 2;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.search-icon {
|
||||
width: 2.3rem;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue