diff --git a/public/scripts/AppCollapsible.js b/public/scripts/AppCollapsible.js index ece272b..02003ee 100644 --- a/public/scripts/AppCollapsible.js +++ b/public/scripts/AppCollapsible.js @@ -3,11 +3,15 @@ export function AppCollapsible(el) { show: true, }; - el.addEventListener('collapse', (e) => update({ show: !e.detail })); + setTimeout(() => el.classList.add('-animated'), 200); - el.querySelector('.bar > .toggle').addEventListener('click', () => - update({ show: !state.show }), - ); + el.addEventListener('collapse', (e) => { + update({ show: typeof e.detail === 'boolean' ? !e.detail : state.show }); + }); + + el.querySelector('.bar > .toggle').addEventListener('click', () => { + update({ show: !state.show }); + }); update(); diff --git a/public/scripts/TodoApp.js b/public/scripts/TodoApp.js index acbd343..1f0a937 100644 --- a/public/scripts/TodoApp.js +++ b/public/scripts/TodoApp.js @@ -33,7 +33,7 @@ export function TodoApp(el) {