summaryrefslogtreecommitdiff
path: root/public/js/modules/event-edit.js
diff options
context:
space:
mode:
authorRaphael Kabo <raphael.kabo@theguardian.com>2024-07-16 13:26:47 +0100
committerRaphael Kabo <raphael.kabo@theguardian.com>2024-07-16 13:26:47 +0100
commit68f5ce96ee19c77d46ddcdd18eefad6257cd47fa (patch)
tree5ad7c125bfb01feb7a718cbf7e80f1c988072678 /public/js/modules/event-edit.js
parentee6ee9aef071162b86c72aea21da483b0bb3e050 (diff)
feat: automatically set end time after start time blurred
Diffstat (limited to 'public/js/modules/event-edit.js')
-rw-r--r--public/js/modules/event-edit.js19
1 files changed, 12 insertions, 7 deletions
diff --git a/public/js/modules/event-edit.js b/public/js/modules/event-edit.js
index 6d2c216..313e8f2 100644
--- a/public/js/modules/event-edit.js
+++ b/public/js/modules/event-edit.js
@@ -18,13 +18,13 @@ $(document).ready(function () {
});
$('#editModal').on('shown.bs.modal', function (e) {
- console.log('hii');
- const ta = document.querySelector("#editModal textarea");
- ta.style.display = 'none';
- autosize(ta);
- ta.style.display = '';
- // Call the update method to recalculate the size:
- autosize.update(ta);
+ console.log('hii');
+ const ta = document.querySelector("#editModal textarea");
+ ta.style.display = 'none';
+ autosize(ta);
+ ta.style.display = '';
+ // Call the update method to recalculate the size:
+ autosize.update(ta);
});
function editEventForm() {
@@ -65,6 +65,11 @@ function editEventForm() {
window.eventData.maxAttendees !== null;
this.data.publicCheckbox = window.eventData.showOnPublicList;
},
+ updateEventEnd() {
+ if (this.data.eventEnd === "" || this.data.eventEnd < this.data.eventStart) {
+ this.data.eventEnd = this.data.eventStart;
+ }
+ },
async submitForm() {
this.submitting = true;
this.errors = [];