aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rw-r--r--static/components/vevent-edit.ts9
-rw-r--r--static/server_connect.ts5
2 files changed, 12 insertions, 2 deletions
diff --git a/static/components/vevent-edit.ts b/static/components/vevent-edit.ts
index ee368296..22e6409a 100644
--- a/static/components/vevent-edit.ts
+++ b/static/components/vevent-edit.ts
@@ -118,9 +118,16 @@ class ComponentEdit extends ComponentVEvent {
}
let submit = this.querySelector('form') as HTMLFormElement
+ /* TODO If start or end DATE is changed, only allow THIS */
+ /* if only time component was changed, allow all */
submit.addEventListener('submit', (e) => {
console.log(submit, e);
- create_event(vcal_objects.get(this.uid)!);
+ // submit button pressed (e.submitter);
+ let submit_type = 'all';
+ if (e.submitter) {
+ submit_type = e.submitter.dataset.key!;
+ }
+ create_event(submit_type, vcal_objects.get(this.uid)!);
e.preventDefault();
return false;
diff --git a/static/server_connect.ts b/static/server_connect.ts
index 61eb4f30..1d181837 100644
--- a/static/server_connect.ts
+++ b/static/server_connect.ts
@@ -54,7 +54,7 @@ async function remove_event(uid: uid) {
// ];
// }
-async function create_event(event: VEvent) {
+async function create_event(submit_type: string, event: VEvent) {
// let xml = event.getElementsByTagName("icalendar")[0].outerHTML
let calendar = event.calendar;
@@ -66,6 +66,9 @@ async function create_event(event: VEvent) {
console.log('calendar=', calendar/*, xml*/);
let data = new URLSearchParams();
+
+ data.append('submit_type', submit_type);
+
data.append("cal", calendar);
// data.append("data", xml);