projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
04ab943
)
Don't try to destroy the upload window if it doesn't exist.
author
Art Cancro
<ajc@citadel.org>
Wed, 11 Oct 2023 22:44:05 +0000
(18:44 -0400)
committer
Art Cancro
<ajc@citadel.org>
Wed, 11 Oct 2023 22:44:05 +0000
(18:44 -0400)
webcit-ng/static/js/upload.js
patch
|
blob
|
history
diff --git
a/webcit-ng/static/js/upload.js
b/webcit-ng/static/js/upload.js
index 6dbd92e64e935fe372de20263131fb839c70e5da..2d0751bafe0abfe382a103730e95b78560b9e7ad 100644
(file)
--- a/
webcit-ng/static/js/upload.js
+++ b/
webcit-ng/static/js/upload.js
@@
-12,7
+12,10
@@
var uploads = [] ; // everything the user has uploaded
// Remove the upload window completely (even if it's hidden)
function deactivate_uploads() {
// Remove the upload window completely (even if it's hidden)
function deactivate_uploads() {
- document.getElementById("ctdl-upload").remove();
+ upload_window = document.getElementById('ctdl-upload');
+ if (upload_window) {
+ upload_window.remove();
+ }
}
}
@@
-151,7
+154,11
@@
function show_or_hide_upload_window() {
// Flush all uploaded files and close the window
function flush_uploads() {
// Flush all uploaded files and close the window
function flush_uploads() {
- document.getElementById('ctdl-upload').style.display='none';
+ upload_window = document.getElementById('ctdl-upload');
+
+ if (upload_window) {
+ upload_window.style.display='none';
+ }
// FIXME tell the server to delete the files
uploads.forEach(u => {
// FIXME tell the server to delete the files
uploads.forEach(u => {