UI: Show title and description in sharing dialogs

This commit is contained in:
Max Berger
2026-04-22 22:30:29 +02:00
parent 66d4827250
commit 7f3895099f
6 changed files with 62 additions and 34 deletions

View File

@@ -29,3 +29,21 @@ export function extract_title(collection) {
} else
return collection.href;
}
/**
* @param {import("../models/collection.js").Collection} collection
* @param {HTMLElement} title_element
* @param {HTMLElement} description_element
*/
export function update_title_and_description(
collection,
title_element,
description_element) {
title_element.textContent = collection.displayname || collection.href;
if (collection.description && collection.description.length > 0) {
description_element.classList.remove("hidden");
description_element.textContent = collection.description;
} else {
description_element.classList.add("hidden");
}
}