diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2020-02-15 23:48:26 +0100 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2020-02-15 23:48:26 +0100 |
commit | 7f84e36fb2f6a380635bc773eae32aa42203422c (patch) | |
tree | da87ac3d533d64aa7371b89ff61522c0710a3cc0 /assets | |
parent | d24d5f2e21fd4bfb5c369e2932a4c62328ffa758 (diff) | |
download | micropoly-7f84e36fb2f6a380635bc773eae32aa42203422c.tar.gz micropoly-7f84e36fb2f6a380635bc773eae32aa42203422c.tar.bz2 micropoly-7f84e36fb2f6a380635bc773eae32aa42203422c.zip |
Improve attachments
- Allow multiple uploads at once
- Make uploads deletable
Diffstat (limited to 'assets')
-rw-r--r-- | assets/interactive.js | 19 | ||||
-rw-r--r-- | assets/styles.css | 5 |
2 files changed, 22 insertions, 2 deletions
diff --git a/assets/interactive.js b/assets/interactive.js index 05b7556..404cc26 100644 --- a/assets/interactive.js +++ b/assets/interactive.js @@ -102,7 +102,7 @@ $(function () { this.set_visible(false); return; } - + this.get_suggestions(input_text, function (suggestions) { console.log(suggestions); suggestions = Array.prototype.slice.call(suggestions, 0); @@ -289,5 +289,20 @@ $(function () { $("button.confirm").on("click", function (ev) { if (!window.confirm($(this).data("question"))) ev.preventDefault(); - }) + }); + + function updateAttachmentDeletionClass(tr) { + tr = $(tr); + tr.toggleClass("delete", tr.find(".attachment-delete-checkbox")[0].checked); + } + + function attachmentDeleteCheckbox(tr) { + $(tr).each(function () { + updateAttachmentDeletionClass(this); + }).find(".attachment-delete-checkbox").on("change", function () { + updateAttachmentDeletionClass($(this).closest("tr")); + }); + } + + attachmentDeleteCheckbox($(".attachments tbody tr")); });
\ No newline at end of file diff --git a/assets/styles.css b/assets/styles.css index b9fca4d..3008b4e 100644 --- a/assets/styles.css +++ b/assets/styles.css @@ -229,4 +229,9 @@ input:placeholder-shown { .autocomplete-root:not(.show-suggestions) ul { display: none; +} + +.attachments .delete { + font-style: italic; + text-decoration: line-through; }
\ No newline at end of file |