[Dublin Template] Missing class causing javascript error in Dublin - Tablet

[Dublin Template] Missing class causing javascript error in Dublin - Tablet

  
Forge Component
(32)
Published on 14 Jun by Labs
32 votes
Published on 14 Jun by Labs

Hi guys,

When adjusting the latest Dublin theme to tablet mode there is a javascript error thrown in regards to the menu:

The error happens when assigning to the appMenu variable:

Checking the html, .Menu_TopMenus doesn't exist, there is the .Application_Menu that's length is checked on the first line, along with the .Menu_TopMenu items that are the children items of the .Application_Menu:

This is causing some other things, like charts, to break on our screens on tablets.

We've checked for this across multiple enviornments/projects using Dublin and also upgraded to the latest version with the same error.

As a workaround we are adding the .Menu_TopMenus class via javascript.

Seems like that javascript isn't supposed to be pointing at the .Menu_TopMenus class, rather the .Application_Menu class.

Thanks,

Justin

Solution

After digging in a bit more, I noticed that if testing a new application, the Menu_TopMenus outer div is generated on a new application.

So in conclusion, I'm not sure if the div was manually deleted by a dev in the Menu web block or what happened. I would assume probably deleted by a dev.

While the user shouldn't delete divs like this, I wonder if there might be a better approach to avoid internal javascript errors like we experienced. Maybe if the div's referenced in the javascript were built in placeholders or something like that.

Thanks,

Justin

Solution

Justin Babel wrote:

Hi guys,

When adjusting the latest Dublin theme to tablet mode there is a javascript error thrown in regards to the menu:

The error happens when assigning to the appMenu variable:

Checking the html, .Menu_TopMenus doesn't exist, there is the .Application_Menu that's length is checked on the first line, along with the .Menu_TopMenu items that are the children items of the .Application_Menu:

This is causing some other things, like charts, to break on our screens on tablets.

We've checked for this across multiple enviornments/projects using Dublin and also upgraded to the latest version with the same error.

As a workaround we are adding the .Menu_TopMenus class via javascript.

Seems like that javascript isn't supposed to be pointing at the .Menu_TopMenus class, rather the .Application_Menu class.

Thanks,

Justin


I have the same error...

Hi Clara,

Did you see my follow up post with the solution? Did this work for you?

Thanks,

Justin

I fixed it by adding a container with the style class Menu_TopMenus inside the Application_Menu container