[TikiWiki-commits] [Git][tikiwiki/tiki][26.x] [BP][FIX] Calendars: Ensure that the page reloads correctly when an event is...

"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6968ed5cd6ac4_2c51f770400f8@gitlab-sidekiq-low-urgency-cpu-bound-v2-7566b5b998-2qbzq.mail>

luci pushed to branch 26.x at Tiki Wiki CMS Groupware / Tiki


Commits:
010e7f0d by Alvin Bauma at 2026-01-15T13:30:44+00:00
[BP][FIX] Calendars: Ensure that the page reloads correctly when an event is deleted and the modal window is closed.
---
* [FIX] Calendar delete event : Ensure that the page reloads correctly when an event is deleted and the modal window is closed.

See merge request tikiwiki/tiki!9165

- - - - -


1 changed file:

- lib/jquery_tiki/tiki-calendar_edit_item.js


Changes:

=====================================
lib/jquery_tiki/tiki-calendar_edit_item.js
=====================================
@@ -369,8 +369,12 @@ $(document).on("ready tiki.modal.redraw", function () {
         } else {
             setTimeout(function () {
                 // TODO better
-                $modal.find(".modal-header").find(".btn-close").click();
-                calendar.refetchEvents();
+                $modal.find(".modal-header").find(".btn-close").trigger("click");
+                if (typeof window.calendar !== 'undefined' && typeof window.calendar.refetchEvents === 'function') {
+                    window.calendar.refetchEvents();
+                } else {
+                    location.reload();
+                }
             }, 500);
         }
     };
@@ -482,10 +486,11 @@ function deletecalItem(event_id, event_name) {
                 $.service("calendar", "delete_item"),
                 {calitemId:event_id},
                 function (data) {
-                    if (typeof calendar.refetchEvents == 'function') {
-                        calendar.refetchEvents();
-                        $.closeModal();
-                    }else{
+                    if (typeof window.calendar !== 'undefined' && typeof window.calendar.refetchEvents === 'function') {
+                        window.calendar.refetchEvents();
+                        $.closeModal({all: true});
+                    } else {
+                        $.closeModal({all: true});
                         location.reload();
                     }
                 }



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/010e7f0d598215776bfe59f53b3885acad8c8c18
You're receiving this email because of your account on gitlab.com.

_______________________________________________
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.