Skip to content

Commit

Permalink
update calendar filter on radio change
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardocavazza committed Apr 3, 2023
1 parent 4f6474c commit ce5f3d0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions webroot/js/CalendarFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -181,6 +182,11 @@ export function defineCalendarFilters(DNA) {
this.updateState();
this.requestSubmit();
break;
default: {
if (type === 'radio' || type === 'checkbox') {
this.requestSubmit();
}
}
}
};

Expand Down
4 changes: 2 additions & 2 deletions webroot/js/index.js
Original file line number Diff line number Diff line change
@@ -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);
4 changes: 2 additions & 2 deletions webroot/js/module.js
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit ce5f3d0

Please sign in to comment.