From 6ca98547a198fc77403e2d926fbf15cff393db97 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 25 Sep 2023 23:35:17 -0400 Subject: [PATCH] Simplify the upload dialog. Reduce the number of divs and make it more generic. Allow the upload dialog to be attached to any parent div. Make the dialog appear automatically when a file is dragged into the parent div. --- webcit-ng/static/css/webcit.css | 46 ++++++++++++-------------------- webcit-ng/static/index.html | 3 --- webcit-ng/static/js/view_mail.js | 33 ++++++++++++----------- 3 files changed, 35 insertions(+), 47 deletions(-) diff --git a/webcit-ng/static/css/webcit.css b/webcit-ng/static/css/webcit.css index ca1e5422c..359b79013 100644 --- a/webcit-ng/static/css/webcit.css +++ b/webcit-ng/static/css/webcit.css @@ -637,44 +637,32 @@ blockquote pre { overflow: hidden; } -.ctdl-compose-attachments-title { - padding: 1em; - background: Gainsboro; - display: flex; - flex-wrap: nowrap; - flex-direction: row; - justify-content: space-between; - align-items: auto; - align-content: start -} - .ctdl-upload { - display: none; /* set to "block" to make the modal appear */ - z-index: 8; - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - border-style: outset; - border-width: 3px; + display: none; /* set to 'block' to make it appear when needed */ + width: 95%; + height: 95%; + border: 2px dashed #ccc; + border-radius: 20px; border-color: Black; justify-content: center; align-items: center; - padding: 10px; + padding: 1em; background-color: GhostWhite; } -.ctdl-upload-drop-area { /* shamelessly swiped from https://www.smashingmagazine.com/2018/01/drag-drop-file-uploader-vanilla-js/ */ - border: 2px dashed #ccc; - border-radius: 20px; - width: 480px; - font-family: sans-serif; - margin: 100px auto; - padding: 20px; +.ctdl-upload.highlight { + border-color: purple; } -.ctdl-upload-drop-area.highlight { - border-color: purple; +.ctdl-compose-attachments-title { + padding: 1em; + background: Gainsboro; + display: flex; + flex-wrap: nowrap; + flex-direction: row; + justify-content: space-between; + align-items: auto; + align-content: start } .my-form { diff --git a/webcit-ng/static/index.html b/webcit-ng/static/index.html index 8b7e0502b..b6f270668 100644 --- a/webcit-ng/static/index.html +++ b/webcit-ng/static/index.html @@ -20,9 +20,6 @@
- -
-