[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [FIX] Correct logic for "Select all" and "Select working days" checkboxes in calendar view

"Baraka Kinywa \(@bkinywa24\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68a5a8a34c993_2c2d30d0440953@gitlab-sidekiq-low-urgency-cpu-bound-v2-78d9d68c78-nn66q.mail>

Baraka Kinywa pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
76f4c455 by Landry Bitege at 2025-08-20T13:43:20+03:00
[FIX] Correct logic for "Select all" and "Select working days" checkboxes in calendar view
---
* [FIX] Correct logic for "Select all" and "Select working days" checkboxes in calendar view
---
* [FIX] Correct logic for "Select all" and "Select working days" checkboxes in calendar view

See merge request tikiwiki/tiki!8098

See merge request tikiwiki/tiki!8337

- - - - -


1 changed file:

- lib/jquery_tiki/tiki-jquery.js


Changes:

=====================================
lib/jquery_tiki/tiki-jquery.js
=====================================
@@ -2976,14 +2976,35 @@ $.curCSS = function (element, property) {
 };
 
 // Select all days or select working days for calendar
-  $(document).ready(function() {
-    $('#select-all-days').on('change', function() {
-      $('input[name="viewdays[]"]').prop('checked', this.checked);
+$(document).ready(function () {
+    const allDays = $("#select-all-days");
+    const workingDays = $("#select-working-days");
+    const viewdays = $('input[name="viewdays[]"]');
+
+    allDays.on("change", function () {
+        if (this.checked) {
+            viewdays.prop("checked", true);
+            workingDays.prop("checked", false);
+        } else {
+            viewdays.prop("checked", false);
+        }
     });
-    $('#select-working-days').on('change', function() {
-      $('input[name="viewdays[]"]').slice(1, -1).prop('checked', this.checked);
+
+    workingDays.on("change", function () {
+        if (this.checked) {
+            viewdays.each(function (index) {
+                $(this).prop("checked", index >= 1 && index <= 5);
+            });
+            allDays.prop("checked", false);
+        } else {
+            viewdays.each(function (index) {
+                if (index >= 1 && index <= 5) {
+                    $(this).prop("checked", false);
+                }
+            });
+        }
     });
-  });
+});
 
 $.fn.registerFacet = function () {
     this.each(function () {



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

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