Defect #22105

Responsive layout. Change menu selector in responsive.js.

Added by Vasil Kovalevsky about 2 years ago. Updated about 2 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:UI - Responsive
Target version:3.2.2
Resolution:Fixed Affected version:

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.

22105.patch Magnifier (1.21 KB) Vasil Kovalevsky, 2016-02-24 05:16

Associated revisions

Revision 15294
Added by Jean-Philippe Lang about 2 years ago

Responsive layout. Change menu selector in responsive.js (#22105).

Patch by Vasil Kovalevsky.

History

#1 Updated by Vasil Kovalevsky about 2 years ago

#2 Updated by Toshi MARUYAMA about 2 years ago

  • Category set to UI - Responsive

#3 Updated by Toshi MARUYAMA about 2 years ago

  • Target version set to 3.2.2

#4 Updated by Jean-Philippe Lang about 2 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Committed, thanks.

Also available in: Atom PDF