JS errors when using a different burger

Created on 17 January 2024, about 1 year ago
Updated 7 February 2024, about 1 year ago

Problem/Motivation

Our custom theme is based on OpenCulturas Base. However, we chose to implement the menu toggle (burger) with different markup, by overriding page.html.twig.

<!--break-->

Now we run into this JS error:

Uncaught TypeError: burgerButtonOpen is null
    menuDialogCleanup [host]/profiles/contrib/openculturas-distribution/profile/themes/openculturas_base/js/openculturas-base.js?s7emi6:198

Proposed resolution

The error is caused by the fact that function menuDialogCleanup tries to update elements that might not exist, in our case the open (#button-offcanvas-open) and close (#button-offcanvas-close) buttons.

It should return early when any of the necessary variables does not exist.

🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

🇩🇪Germany mrshowerman Munich

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024