Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

[BUG] Expand to menu item hides all other items #144

Open
andreasvatne opened this issue Feb 17, 2016 · 8 comments
Open

[BUG] Expand to menu item hides all other items #144

andreasvatne opened this issue Feb 17, 2016 · 8 comments
Assignees

Comments

@andreasvatne
Copy link

After postback I'd like to re-open the menu and show the current page I am on in the menu. According to the spec, this is done using 'expand' (see description below).

Even though the actual menu item is found and shown in the menu, all other menu items disappear.

To reproduce the problem, go to this demo page:
http://multi-level-push-menu.make.rs/demo/covermode/covermode.html

Open console and run this script:
$( '#menu' ).multilevelpushmenu( 'expand' , $( '#menu' ).multilevelpushmenu( 'finditemsbyname' , 'Rambler' ).first() );


This is what the spec says:
$( '#menu' ).multilevelpushmenu( 'findmenusbytitle' , 'Mobile Phones' );

and then invoke expand method with desired menu level object (e.g. if we have several menu objects with title 'Mobile Phones' but we want to expand the first one)
var $phonemenu = $( '#menu' ).multilevelpushmenu( 'findmenusbytitle' , 'Mobile Phones' ).first();
and then
$( '#menu' ).multilevelpushmenu( 'expand' , $phonemenu );

@adgsm
Copy link
Owner

adgsm commented Feb 17, 2016

Thanks for spotting this.

@adgsm adgsm added the bug label Feb 17, 2016
@adgsm adgsm self-assigned this Feb 17, 2016
@andreasvatne
Copy link
Author

I've tracked down the cause to be the "visibility" attribute of the menu item siblings + the div containing the back button (.backItemClass). If I set them to "Visible" they are displayed, and I also have to reset the width of the target menu element (it's not filling the width of the menu 100%).

@andreasvatne
Copy link
Author

Hi, is there an ETA on this fix?

Thanks,
Andreas

@adgsm
Copy link
Owner

adgsm commented Mar 15, 2016

Hi Andreas,
Usually I do it faster but I'm deadly busy with projects I'm legally contracted to do... I hope to have it fixed during next weekend...
Regards

@dokane
Copy link

dokane commented Mar 18, 2016

+1

Thanks for the update @adgsm.

@adgsm
Copy link
Owner

adgsm commented Apr 5, 2016

hm... I just had a quick look again on how did you produce such behaviour.
It is expected to expand to menu, not to an item...

in other words if you have menu with title 'Rambler' following will expand to it.

$( '#menu' ).multilevelpushmenu( 'expand' , $( '#menu' ).multilevelpushmenu( 'findmenusbytitle' , 'Rambler' ).first() ); 

@adgsm adgsm removed the bug label Apr 7, 2016
@adgsm
Copy link
Owner

adgsm commented Jul 13, 2016

Hi,

You should be using
findmenusbytitle

instead of

finditemsbyname

method.

Regards

On Jul 13, 2016, at 13:57, andreasvatne [email protected] wrote:

Hi, I've been stuck with other projects but thought I'd have another look at this. I'm still thinking there is a bug somewhere, just check this out (I'm using Chrome):

Go to your demo page at this url: http://multi-level-push-menu.make.rs/demo/covermode/covermode.html http://multi-level-push-menu.make.rs/demo/covermode/covermode.html
Verify that there is a sub menu item under "Devices" called "Mobile Phones". This item has several sub items ("Super Smart Phone", "Thin Magic Mobile" etc).
It is my understanding that the following command should open the "Mobile Phones" menu item, and display the sub items ("Super Smart Phone", "Thin Magic Mobile" etc):
$( '#menu' ).multilevelpushmenu( 'expand' , $( '#menu' ).multilevelpushmenu( 'finditemsbyname' , 'Mobile Phones' ).first() );

What I get is the "Mobile Phones" item, but without any sub items:
https://cloud.githubusercontent.com/assets/2426640/16802485/24ff7c28-4901-11e6-867f-87498812349c.png
What I expect is the same as if I clicked "Devices" -> "Mobile Phones":
https://cloud.githubusercontent.com/assets/2426640/16802521/5357e6b4-4901-11e6-8119-c5d5d3d0e870.png
Have I misunderstood the "expand" command?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #144 (comment), or mute the thread https://github.com/notifications/unsubscribe/AFhKYxaRRf3kSUiwxEpuofvRz09xi4M5ks5qVNKhgaJpZM4HcA5l.

@andreasvatne
Copy link
Author

andreasvatne commented Jul 13, 2016

Hi, yes I just deleted my comment when I realized that this command does what I want:

$('#menu').multilevelpushmenu('expand', 'Magazines');

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants