mirror of
https://github.com/simon987/sist2.git
synced 2025-04-20 10:46:45 +00:00
Handle null mime in document info dialog
This commit is contained in:
parent
9568e25f84
commit
23f7810e68
@ -195,17 +195,21 @@ function makeUserTag(tag, hit) {
|
|||||||
function infoButtonCb(hit) {
|
function infoButtonCb(hit) {
|
||||||
return () => {
|
return () => {
|
||||||
getDocumentInfo(hit["_id"]).then(doc => {
|
getDocumentInfo(hit["_id"]).then(doc => {
|
||||||
|
$("#modal-body").empty()
|
||||||
|
|
||||||
$("#modal-title").text(doc["name"] + ext(hit));
|
$("#modal-title").text(doc["name"] + ext(hit));
|
||||||
|
|
||||||
|
if (doc["mime"]) {
|
||||||
const mimeCategory = doc["mime"].split("/")[0];
|
const mimeCategory = doc["mime"].split("/")[0];
|
||||||
const imgWrapper = document.createElement("div");
|
const imgWrapper = document.createElement("div");
|
||||||
imgWrapper.setAttribute("style", "position: relative");
|
imgWrapper.setAttribute("style", "position: relative");
|
||||||
imgWrapper.setAttribute("class", "img-wrapper");
|
imgWrapper.setAttribute("class", "img-wrapper");
|
||||||
makeThumbnail(mimeCategory, hit, imgWrapper, false);
|
makeThumbnail(mimeCategory, hit, imgWrapper, false);
|
||||||
|
$("#modal-body").append(imgWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
const tbody = $("<tbody>");
|
const tbody = $("<tbody>");
|
||||||
$("#modal-body").empty()
|
$("#modal-body")
|
||||||
.append(imgWrapper)
|
|
||||||
.append($("<table class='table table-sm'>")
|
.append($("<table class='table table-sm'>")
|
||||||
.append($("<thead>")
|
.append($("<thead>")
|
||||||
.append($("<tr>")
|
.append($("<tr>")
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user