diff --git a/src/core/static/js/events.js b/src/core/static/js/events.js
index 2389a83..19962ba 100644
--- a/src/core/static/js/events.js
+++ b/src/core/static/js/events.js
@@ -39,9 +39,9 @@ const openFile = (eve) => {
if (ftype === "dir") {
listFilesAjax(hash);
} else if (ftype === "video") {
- showMedia(hash, extension, "video");
+ showFile(title, hash, extension, "video");
} else {
- showMedia(hash, extension, "file");
+ showFile(title, hash, extension, "file");
}
}
diff --git a/src/core/static/js/react-ui-logic.js b/src/core/static/js/react-ui-logic.js
index 779a422..8ff47b1 100644
--- a/src/core/static/js/react-ui-logic.js
+++ b/src/core/static/js/react-ui-logic.js
@@ -78,13 +78,13 @@ class FilesList extends React.Component {
diff --git a/src/core/static/js/ui-logic.js b/src/core/static/js/ui-logic.js
index db9d377..cabcb13 100644
--- a/src/core/static/js/ui-logic.js
+++ b/src/core/static/js/ui-logic.js
@@ -16,13 +16,31 @@ const scrollFilesToTop = () => {
}
-const showMedia = async (hash, extension, type) => {
+const closeFile = () => {
+ const video = document.getElementById("video");
+ let title = document.getElementById("selectedFile");
+
+ document.getElementById("image-viewer").style.display = "none";
+ document.getElementById("text-viewer").style.display = "none";
+ document.getElementById("pdf-viewer").style.display = "none";
+ document.getElementById("video-controls").style.display = "none";
+
+ title.innerText = "";
+ video.style.display = "none";
+ video.style.cursor = '';
+ video.pause();
+}
+
+const showFile = async (title, hash, extension, type) => {
document.getElementById("image-viewer").style.display = "none";
document.getElementById("text-viewer").style.display = "none";
document.getElementById("pdf-viewer").style.display = "none";
document.getElementById("video").style.display = "none";
document.getElementById("video-controls").style.display = "none";
+ let titleElm = document.getElementById("selectedFile");
+ titleElm.innerText = title;
+
if (type === "video") {
setupVideo(hash, extension);
}
diff --git a/src/core/static/js/video-events.js b/src/core/static/js/video-events.js
index 0bc8c0b..1789017 100644
--- a/src/core/static/js/video-events.js
+++ b/src/core/static/js/video-events.js
@@ -16,11 +16,6 @@ const getTimeFormatted = (duration = null) => {
return hours + ":" + minutes + ":" + seconds;
}
-const pauseVideo = () => {
- const video = document.getElementById("video");
- video.style.cursor = '';
- video.pause();
-}
const togglePlay = (video) => {
shouldPlay = setTimeout(function () {
diff --git a/src/core/templates/modals/file-modal.html b/src/core/templates/modals/file-modal.html
index 78c8983..876c5d3 100644
--- a/src/core/templates/modals/file-modal.html
+++ b/src/core/templates/modals/file-modal.html
@@ -4,8 +4,8 @@