[TikiWiki-commits] [Git][tikiwiki/tiki][28.x] [BP][FIX] Correct logic for "Select all" and "Select working days" checkboxes in calendar view
"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <68a6d68ac988e_2cd6d80150cc@gitlab-sidekiq-low-urgency-cpu-bound-v2-5546c8c99c-cc6hl.mail> |
luci pushed to branch 28.x at Tiki Wiki CMS Groupware / Tiki
Commits:
f6d71310 by Landry Bitege at 2025-08-21T08:12:30+00:00
[BP][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
---
* [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
See merge request tikiwiki/tiki!8343
- - - - -
1 changed file:
- lib/jquery_tiki/tiki-jquery.js
Changes:
=====================================
lib/jquery_tiki/tiki-jquery.js
=====================================
@@ -3785,14 +3785,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/f6d7131069c7e83eeaddd8509f9ab16b3f362619
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f6d7131069c7e83eeaddd8509f9ab16b3f362619
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