|
@@ -6,10 +6,10 @@ export default class extends Controller {
|
|
|
const form = document.querySelector('form')
|
|
|
if (sessionStorage.getItem('size')) {
|
|
|
main.classList.toggle('size-max', true)
|
|
|
- form.classList.toggle('size-max-form', true)
|
|
|
+ if (form) form.classList.toggle('size-max-form', true)
|
|
|
} else {
|
|
|
main.classList.toggle('size-max', false)
|
|
|
- form.classList.toggle('size-max-form', false)
|
|
|
+ if (form) form.classList.toggle('size-max-form', false)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -17,10 +17,10 @@ export default class extends Controller {
|
|
|
const main = document.querySelector('main')
|
|
|
const form = document.querySelector('form')
|
|
|
if (main.classList.toggle('size-max')) {
|
|
|
- form.classList.toggle('size-max-form', true)
|
|
|
+ if (form) form.classList.toggle('size-max-form', true)
|
|
|
sessionStorage.setItem('size', 'size-max')
|
|
|
} else {
|
|
|
- form.classList.toggle('size-max-form', false)
|
|
|
+ if (form) form.classList.toggle('size-max-form', false)
|
|
|
sessionStorage.removeItem('size')
|
|
|
}
|
|
|
}
|