I'm replacing the redmond theme of an existing application with omega theme + layout. I noticed that the menu state is not working correctly. Sometimes it doesn't highlights anything, sometimes it highlights the wrong item and sometimes it highlights more than one item.
I took a look at layout.js, but I was not able to figure out what is going on.
http://54.94.142.248/cliente1977
Could you please take a look? Username 1, password test
Test case: navigate to Consultas > Senhas, the menu state is saved correctly. After navigate to Consultas > Solicitações, the menu item "Comunicados" is highlighted.
Thanks in advance
Problem with menu state
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Thanks for the sample. Do menuitems have the unique ids on your menu?
Github Profile: https://github.com/mertsincan
Adding fixed ids solves the issue.
As a suggestion for enhancement, on layout.js you could replace {path: '/'} with {path: '<<context path from jsf>>'}. I have more than one webapp with omega on the same server, so when I reset the menu state for one it affects the other. I could simply edit layout.js, but I prefer keeping the layout files original for an easier upgrade if a new version is available.
Thanks
As a suggestion for enhancement, on layout.js you could replace {path: '/'} with {path: '<<context path from jsf>>'}. I have more than one webapp with omega on the same server, so when I reset the menu state for one it affects the other. I could simply edit layout.js, but I prefer keeping the layout files original for an easier upgrade if a new version is available.
Thanks
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Glad to hear, thanks a lot for the update! I think you can override layout.js. My example code for you;
Best Regards,
Code: Select all
//template.xhtml
<script id="layoutScriptId" type="text/javascript" src="#{request.contextPath}/resources/ultima-layout/js/layout.js" data-contextPath="#{request.contextPath}" />
//layout.js
init: function(cfg) {
..
this.path = $('#layoutScriptId').attr('data-contextPath');
}
...
saveMenuState: function() {
$.cookie('ultima_expandeditems', this.expandedMenuitems.join(','), {path: this.path});
},
clearMenuState: function() {
$.removeCookie('ultima_expandeditems', {path: this.path});
},
setInlineProfileState: function(expanded) {
if(expanded)
$.cookie('ultima_inlineprofile_expanded', "1", {path: this.path});
else
$.removeCookie('ultima_inlineprofile_expanded', {path: this.path});
},
Github Profile: https://github.com/mertsincan
-
- Information
-
Who is online
Users browsing this forum: No registered users and 18 guests