[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [BP][FIX][UX] Calendar: Calendar change field refresh and new-event modal save

"MAGENE Sem Joel \(@Jomagene\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69e6bcca344c2_3818f948823a9@gitlab-sidekiq-low-urgency-cpu-bound-v2-7cbcb67f54-skn68.mail>

MAGENE Sem Joel pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
ccfc7f92 by MAGENE Sem Joel at 2026-04-20T23:47:23+00:00
[BP][FIX][UX] Calendar: Calendar change field refresh and new-event modal save
---
* [BP][FIX][UX] Calendar: Calendar change field refresh and new-event modal save
---
* [BP][FIX][UX] Calendar: Calendar change field refresh and new-event modal save
---
* [FIX][UX] Calendar: Calendar change field refresh and new-event modal save
---
* [FIX][UX] Calendar: Calendar-change field refresh and new-event modal save

See merge request tikiwiki/tiki!9973

(cherry picked from commit e4609a95124228aa8906296a5616b37e14e58b1e)

See merge request tikiwiki/tiki!10054

(cherry picked from commit 94113fa43457377ca043cc703062e181e6a09063)

See merge request tikiwiki/tiki!10057

(cherry picked from commit 188b5ec4438ec43d67a6a38674b25ecafbf18d78)

See merge request tikiwiki/tiki!10059

- - - - -


2 changed files:

- lib/jquery_tiki/tiki-calendar_edit_item.js
- src/js/jquery-tiki/tiki-calendar.js


Changes:

=====================================
lib/jquery_tiki/tiki-calendar_edit_item.js
=====================================
@@ -238,6 +238,20 @@ function handleEditCalendarItem() {
         $('#add_participant_email').val('');
     });
 
+    // Reload form fields when calendar changes, so custom options match selected calendar.
+    $(document)
+        .off("change.calendarEditItem", ".edit-event-form select#calid")
+        .on("change.calendarEditItem", ".edit-event-form select#calid", function () {
+            const $form = $(this).closest(".edit-event-form");
+            if (!$form.length) {
+                return;
+            }
+            $form.tikiModal(tr("Loading..."));
+            window.needToConfirm = false;
+            $form.find("input[name=calendarchanged]").val(1);
+            $form.find("input[name=saveitem]").trigger("click");
+        });
+
     // process form submits etc
     $(document).on("click", ".edit-event-form input[type=submit]", function (event) {
         // add a hidden input version of this form as jQuery.fn.serialize doesn't include the clicked button


=====================================
src/js/jquery-tiki/tiki-calendar.js
=====================================
@@ -234,7 +234,14 @@ $.fn.setupFullCalendar = function (
                             remote: $.service("calendar", "edit_item", { todate: info.date.toUnix(), modal: 1, return_url: returnUrl }),
                             open: function () {
                                 $this.tikiModal();
-                                $("form:not(.no-ajax)", this).addClass("no-ajax"); // Remove default ajax handling, we replace it
+                                $("form:not(.no-ajax)", this)
+                                    .addClass("no-ajax") // Remove default ajax handling, we replace it
+                                    .on(
+                                        "submit",
+                                        ajaxSubmitEventHandler(function (data) {
+                                            calendarEditSubmit(data, this);
+                                        })
+                                    );
                             },
                         });
                     } else {



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/ccfc7f92c6d547ad7821cf8b6443b0bdb350ec40

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/ccfc7f92c6d547ad7821cf8b6443b0bdb350ec40
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.