Topic: MifMenu - hide on mouseout

moro,

I've been playing with your context menu control. My questions so far:

1. Is there a property to tell menu to hide when mouse moves outside of it?

2. Can the menu disappear after right- or left-click events elsewhere on the page?

3. Is there a way to configure menu so it would not use Fx.Morph and shadow?

Thanks

Last edited by temuri (2008-10-01 16:37:24)

Re: MifMenu - hide on mouseout

1. I can add this functionality, but don't want, windows menu don't hide on mouse out.
2. it's disapear on mousedown now. I'm think it's enough.
3. for Fx.Morph set duration to 0 it's almost the same as no Fx.Morph. For shadow u can either create your own container, or configure Mif.Menu.Container with options:

...
offsets:{
    t: 0,
    r: 0,
    b: 0,
    l: 0
},
...

Re: MifMenu - hide on mouseout

1. ok, I see your point. But, could you tell me where in the code it's suitable to add onmouseout event? I'll have to customize it for my needs.
2. yes. however, if you have more than one target object and you use two different menus, I can rightclick on the first and rightclick on the second. Thus, I'll have two menus at the same time. In my opinion, not only mousedown, but right-click event should also close current menu.


thanks.

Re: MifMenu - hide on mouseout

1. List::initEvents

add something like:

this.container.addEvent('mouseout', function(event){
     var relatedTarget=event.relatedTarget;
     check that it's not other list
     this.list.menu.hide();
}.bind(this))

2. Yes it's bad, will be fixed.

Re: MifMenu - hide on mouseout

moro,

has number 2 been fixed, by any chance?

Thanks

Re: MifMenu - hide on mouseout

fixed hide on right button.

Re: MifMenu - hide on mouseout

I looked inside your code - there's a lot of stuff going on when you render menu shadow.

Question - would it not be more optimal to bypass all that code using IF and add "noshadow" parameter?