ElkArte Community

Elk Development => Bug Reports => Topic started by: Antechinus on June 09, 2013, 01:15:01 am

Title: Buglet of the minor variety: click menu closing.
Post by: Antechinus on June 09, 2013, 01:15:01 am
Try this. Select click menu option in profile. Open a droppy.

Click somewhere outside the theme wrapper/frame divs (ie: body background).

Menu doesn't close. Just stays there. Click again inside theme wrapper > menu closes.

Had a quick look inside the jQ stuffz but couldn't see anything obvious. Should be tweaked so that clicking anywhere outside the menu closes it, IMO.

I've been using this on my homecooked click menu, which probably isn't directly usable with Superfish but illustrates the point.

Code: [Select]
// Click anywhere else to close.
                $(document).live("click", function(e) {
                    var $clicked = $(e.target);
                    if (! $clicked.parents().is("li.dropmenu"))
                        $("li.dropmenu>ul").css("display","none");
                });

ETA: Also, looking at Superfish, it's using some of the slowest jQ bits to deal with its eye candy (ie: show/hide instead of css("stuff")).
Title: Re: Buglet of the minor variety: click menu closing.
Post by: emanuele on June 09, 2013, 03:26:53 am
Quote from: Antechinus – ETA: Also, looking at Superfish, it's using some of the slowest jQ bits to deal with its eye candy (ie: show/hide instead of css("stuff")).
https://github.com/emanuele45/Dialogo/commit/97945aaf5f8bc1875c165d162b74528ac0a6c43d#commitcomment-3353881
Title: Re: Buglet of the minor variety: click menu closing.
Post by: Spuds on June 09, 2013, 07:47:33 am
Also, As of jQuery 1.7, the .live() method is deprecated. We are on 1.9.1
Title: Re: Buglet of the minor variety: click menu closing.
Post by: Antechinus on June 09, 2013, 05:39:57 pm
Fair nuff. Point was the trigger for closing seems to be restricted to areas within the theme wrapper, which seems like a buglet to me. It can just as easily be coded to close the menu if you click anywhere.
Title: Re: Buglet of the minor variety: click menu closing.
Post by: Spuds on June 09, 2013, 07:01:51 pm
Totally agree ... Joel is aware of the issue, its mostly why the click stuff was separated from the hover stuff ... the click (or off click) acted very differently across multiple browsers, tablets, phones, os's   Of course since he did that he has not done any work on the click side of things, I'm sure he will get back to it at some point, if someone else in github land does not do it first.
Title: Re: Buglet of the minor variety: click menu closing.
Post by: Flavio93Zena on May 14, 2016, 10:14:01 pm
Uber bump, this is still a thing.
Title: Re: Buglet of the minor variety: click menu closing.
Post by: emanuele on May 15, 2016, 03:55:07 am
I know, it has not been moved to fixed. :P
Title: Re: Buglet of the minor variety: click menu closing.
Post by: Flavio93Zena on May 15, 2016, 09:53:17 am
Aye but it's been 3 years, time to look at it  :-[ I don't want the board to end up like the 7 pages of crap there are on smf.
Title: Re: Buglet of the minor variety: click menu closing.
Post by: emanuele on May 15, 2016, 02:31:35 pm
Each bug has a priority, this one is one of the lowest.
The fact that bugs accumulate it's absolutely normal and physiological in any projects (AFAIK it's a well documented pattern), nothing to worry about.
Title: Re: Buglet of the minor variety: click menu closing.
Post by: Antechinus on May 15, 2016, 04:59:05 pm
For anyone who's interested and didn't already know: the reason it was coded this way is because iShiz won't recognise clicky on the body tag. Only works on children of body. If you wanted to sort things so that clicky worked anywhere, you'd need an extra div in the markup that covered the whole screen, with the forum stuffz inside that.

Easy to do. Whether or not it's worth doing is personal preference. Me? I don't care either way.