diff --git a/app/javascript/controllers/collapsible_columns_controller.js b/app/javascript/controllers/collapsible_columns_controller.js index cd533220e..26950f36a 100644 --- a/app/javascript/controllers/collapsible_columns_controller.js +++ b/app/javascript/controllers/collapsible_columns_controller.js @@ -152,12 +152,12 @@ export default class extends Controller { this.titleTargets.forEach(title => this._intersectionObserver.observe(title)) } - #isDesktop(e) { - return e.matches ?? e + get #isDesktop() { + return this.mediaQuery?.matches } - #handleDesktop(e) { - this.#isDesktop(e) ? this.#handleDesktopMode() : this.#handleMobileMode() + #handleDesktop() { + this.#isDesktop ? this.#handleDesktopMode() : this.#handleMobileMode() } async #handleDesktopMode() {