Post Closed
71
Views
6
Comments
Solved
[Dublin Template] Missing class causing javascript error in Dublin - Tablet
dublin-template
Web icon
Forge asset by OutSystems

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

2024-04-24 19-28-09
Justin Babel
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

2018-06-01 14-41-55
Clara Cruz Correia

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...

2024-04-24 19-28-09
Justin Babel

Hi Clara,

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

Thanks,

Justin

2018-06-01 14-41-55
Clara Cruz Correia

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


2021-03-05 13-56-11
Ricardo Pereira
 
MVP

I'm having the same problem in LisbonTheme...Styles desapearing and some containers too and no one are deleting them...

2018-06-01 14-41-55
Clara Cruz Correia

Ricardo Pereira wrote:

I'm having the same problem in LisbonTheme...Styles desapearing and some containers too and no one are deleting them...


When you create a new application is everything there?

I just compared a new one with mine and I found where the items that were missing should go. However I don't know why they disapeared, but the problem never happend again after fixing all the mistakes.