mirror of
https://github.com/simon987/sist2.git
synced 2025-12-16 08:49:07 +00:00
frontend tags
This commit is contained in:
@@ -338,9 +338,27 @@ function createDocCard(hit) {
|
||||
|
||||
docCardBody.appendChild(tagContainer);
|
||||
|
||||
attachTagContainerEventListener(tagContainer);
|
||||
return docCard;
|
||||
}
|
||||
|
||||
function attachTagContainerEventListener(tagContainer) {
|
||||
const sizeTag = Array.from(tagContainer.children).find(child => child.tagName === "SMALL");
|
||||
|
||||
const addTagButton = document.createElement("span");
|
||||
addTagButton.setAttribute("class", "badge badge-pill add-tag-button");
|
||||
addTagButton.appendChild(document.createTextNode("+Add"));
|
||||
|
||||
tagContainer.addEventListener("mouseenter", () => tagContainer.insertBefore(addTagButton, sizeTag));
|
||||
tagContainer.addEventListener("mouseleave", () => addTagButton.remove());
|
||||
|
||||
addTagButton.addEventListener("click", () => {
|
||||
tagBar.value = "";
|
||||
$("#tagModal").modal("show");
|
||||
tagBar.focus();
|
||||
});
|
||||
}
|
||||
|
||||
function makeThumbnail(mimeCategory, hit, imgWrapper, small) {
|
||||
|
||||
if (!hit["_source"].hasOwnProperty("thumbnail")) {
|
||||
|
||||
Reference in New Issue
Block a user