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

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69e622d5f129_3b18e1b06585a@gitlab-sidekiq-low-urgency-cpu-bound-v2-868995cff8-7q6dl.mail>

Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
e4609a95 by MAGENE Sem Joel at 2026-04-20T12:50:12+00:00
[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

- - - - -


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
=====================================
@@ -129,6 +129,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
=====================================
@@ -72,7 +72,14 @@ $.fn.setupEventCalendar = function (
                     remote: $.service("calendar", "edit_item", params),
                     open: function () {
                         $(calendarEl).tikiModal();
-                        $("form:not(.no-ajax)", this).addClass("no-ajax");
+                        $("form:not(.no-ajax)", this)
+                            .addClass("no-ajax") // Remove default ajax handling, we replace it
+                            .on(
+                                "submit",
+                                ajaxSubmitEventHandler(function (data) {
+                                    calendarEditSubmit(data, this);
+                                })
+                            );
                         isOpeningModal = false;
                     },
                     error: function () {



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/e4609a95124228aa8906296a5616b37e14e58b1e
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.