Defect #22105
closedResponsive layout. Change menu selector in responsive.js.
0%
Description
Hello.
In our redmine we are using custom menu with sub items and other cool things.
Everything was nice before there is was added responsive layout in redmine.
Menu works before window resize less than 899px (responsive.css media max-width: 899px) and groving up more 899px our menu stays flatten (in mobile view a lot of functions works good).
Reason - wrong (for us) selector in responsive.js
So, there is 2 variables (functions):
_initMobileMenu and _initDesktopMenu
_initMobileMenu:
$('#main-menu > ul').detach().appendTo('.js-project-menu'); $('#top-menu > ul').detach().appendTo('.js-general-menu'); $('#sidebar > *').detach().appendTo('.js-sidebar'); $('#account ul').detach().appendTo('.js-profile-menu'); // bad selector
better change to
$('#main-menu > ul').detach().appendTo('.js-project-menu'); $('#top-menu > ul').detach().appendTo('.js-general-menu'); $('#sidebar > *').detach().appendTo('.js-sidebar'); $('#account > ul').detach().appendTo('.js-profile-menu'); // changed to only child uls (no subchilds)
_initDesktopMenu:
$('.js-project-menu > ul').detach().appendTo('#main-menu'); $('.js-general-menu ul').detach().appendTo('#top-menu'); // bad selector $('.js-sidebar > *').detach().appendTo('#sidebar'); $('.js-profile-menu ul').detach().appendTo('#account'); // bad selector
better change to
$('.js-project-menu > ul').detach().appendTo('#main-menu'); $('.js-general-menu > ul').detach().appendTo('#top-menu'); // changed to only child uls (no subchilds) $('.js-sidebar > *').detach().appendTo('#sidebar'); $('.js-profile-menu > ul').detach().appendTo('#account'); // changed to only child uls (no subchilds)
And responsive.js was wrote that we cannot patch anything there, only direct change in source (or I missed something), but we dont change any source of redmine (its our rule).
Please, if its not hard, add this small changes to some release, its not about redmine, its about our system. Of cource, we can change our menu structure (move ul to div\span), but its very long for us (a lot of changes need to do: style, rednder, js, items tree).
Now we just disabled responsive menu, but its not good solution.
Thanks in advance.
Files
Updated by Vasil Kovalevsky almost 9 years ago
- File 22105.patch 22105.patch added
Updated by Jean-Philippe Lang over 8 years ago
- Status changed from New to Closed
- Assignee set to Jean-Philippe Lang
- Resolution set to Fixed
Committed, thanks.