From ce5f3d0ce95ac4c7fd19c55ec9847f9e83106ae5 Mon Sep 17 00:00:00 2001 From: Edoardo Cavazza Date: Mon, 3 Apr 2023 17:19:38 +0200 Subject: [PATCH 1/3] update calendar filter on radio change --- webroot/js/CalendarFilters.js | 6 ++++++ webroot/js/index.js | 4 ++-- webroot/js/module.js | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/webroot/js/CalendarFilters.js b/webroot/js/CalendarFilters.js index a77f32c..33db6c9 100644 --- a/webroot/js/CalendarFilters.js +++ b/webroot/js/CalendarFilters.js @@ -161,6 +161,7 @@ export function defineCalendarFilters(DNA) { } const name = target.getAttribute('name'); + const type = target.getAttribute('type'); switch (name) { case this.monthParam: case this.yearParam: @@ -181,6 +182,11 @@ export function defineCalendarFilters(DNA) { this.updateState(); this.requestSubmit(); break; + default: { + if (type === 'radio' || type === 'checkbox') { + this.requestSubmit(); + } + } } }; diff --git a/webroot/js/index.js b/webroot/js/index.js index 49c376f..66abde6 100644 --- a/webroot/js/index.js +++ b/webroot/js/index.js @@ -1,4 +1,4 @@ -import * as DNA from 'https://unpkg.com/@chialab/dna?module' -import { defineCalendarFilters } from './CalendarFilters.js' +import * as DNA from 'https://unpkg.com/@chialab/dna?module'; +import { defineCalendarFilters } from './CalendarFilters.js'; export const CalendarFilters = defineCalendarFilters(DNA); diff --git a/webroot/js/module.js b/webroot/js/module.js index ae5544b..67f62d5 100644 --- a/webroot/js/module.js +++ b/webroot/js/module.js @@ -1,4 +1,4 @@ -import * as DNA from '@chialab/dna' -import { defineCalendarFilters } from './CalendarFilters.js' +import * as DNA from '@chialab/dna'; +import { defineCalendarFilters } from './CalendarFilters.js'; export const CalendarFilters = defineCalendarFilters(DNA); From 597d5f3996b595c18e3ce41864fe0e3ecc39aa49 Mon Sep 17 00:00:00 2001 From: Edoardo Cavazza Date: Mon, 3 Apr 2023 17:21:16 +0200 Subject: [PATCH 2/3] update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c3e8987..abff7c1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Chialab/Calendar -**Calendar** is a [BEdita 4](https://www.bedita.com/) plugin designed render and filter calendar views. +**Calendar** is a [BEdita 4](https://www.bedita.com/) plugin designed to render and filter calendar views. ## Usage From 3e6045fc0705991c63e5ec11d6fd5d75a7d5c5cf Mon Sep 17 00:00:00 2001 From: Edoardo Cavazza Date: Wed, 5 Apr 2023 12:59:44 +0200 Subject: [PATCH 3/3] partially revert 4f6474c --- webroot/js/CalendarFilters.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/webroot/js/CalendarFilters.js b/webroot/js/CalendarFilters.js index 33db6c9..a77f32c 100644 --- a/webroot/js/CalendarFilters.js +++ b/webroot/js/CalendarFilters.js @@ -161,7 +161,6 @@ export function defineCalendarFilters(DNA) { } const name = target.getAttribute('name'); - const type = target.getAttribute('type'); switch (name) { case this.monthParam: case this.yearParam: @@ -182,11 +181,6 @@ export function defineCalendarFilters(DNA) { this.updateState(); this.requestSubmit(); break; - default: { - if (type === 'radio' || type === 'checkbox') { - this.requestSubmit(); - } - } } };