Parent Menu Item with Sub Menus take 2 Clicks to Open

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Thu Jun 05, 2014 7:47 am
Reply with quote
Report this post
In my Gavick template, I noticed that if I have a parent menu item (in main menu) with sub-menus in it, then the parent menu takes 2 clicks to open that page. I find this annoying since some users might still prefer to click on the Parent Menu link directly even if it has sub-menus in drop-down. How can I change this so the parent menu is clickable with single click instead of 2 clicks? This only happens when the menus item has sub-menus. If it has no child, then the parent menu is clickable with a single click. Here is a structure of the menu item:

-> Games (Links to Games Category directly. When I click on this parent item, it takes 2 clicks to open this page if it has sub-menus.)
- - > Playstation (Links to a category)
- - > XBox (Links to a category)
- - > Nintendo (Links to a category)

I havent been able to figure out why this is happening and what to do so the parent menu opens the page with single click itself even if a sub-menu isn't clicked. Is this an expected behaviour when a menu item has sub-menus? Can this be changed?

I am using Game template for Joomla 3.3 in localhost. I tested this with Google Chrome Sorry dont have an URL yet.
User avatar
Senior Boarder

teitbite
Thu Jun 05, 2014 8:24 am
Reply with quote
Report this post
Hi

What browser are You using ? I've tested Game demo with Firefox and have no such problem. In the matter of fact submenu is visible on mouse over the parent, no click needed at all. Please try test in demo page and let me know if it works same there as well.
User avatar
Moderator

GK User
Thu Jun 05, 2014 9:11 am
Reply with quote
Report this post
Hi Teitbite, Sorry you have misunderstood. I wasnt referring to submenu visible over mouse hover on parent since that works fine. I was actually talking about the main Parent item's link. For instance, in the Demo page, the Parent Item "Games" in main menu is a text separator so it doesnt have a link so nothing happens if clicked on it. But have a look at "EasyBlog" menu item. This parent menu item itself is linked to a category view page so if it is clicked directly (without clicking on any sub-menus), it opens that page. This is working fine in 2.5 version of the template and that is the behaviour I want. But in the 3.3 version of this template, when I click on the parent item that has its own link, it doesnt go to the page unless the item is clicked twice. Unfortunately I cant see the 3.3 version demo with this example for this template to show you.
User avatar
Senior Boarder

GK User
Thu Jun 05, 2014 10:32 am
Reply with quote
Report this post
If other havent experienced this with this template, then I am beginning to think if this only happens in my Wamp server. I will try it on my live site in the next few months and see if it happens there too. :)
User avatar
Senior Boarder

teitbite
Fri Jun 06, 2014 5:20 pm
Reply with quote
Report this post
Hi

I think I need to wait for You to move it to a live server. I've just installed a quickstart on my localhost and I do not need a click to open submenu. Or I'm still not getting what You have in mind ;/
User avatar
Moderator

GK User
Tue Jun 17, 2014 11:12 am
Reply with quote
Report this post
Hi Teitbite,

I just happened to come across this site (found it in another topic) which should show a demo of the problem I am referring to: http://www.bluestreamav.com.au/

Have a look at the "Products" menu item. Here you will find that the "Products" menu has a drop-down that shows on hover. Dont worry about the drop-down menu for now, but if you noticed, this root menu item itself is linked to http://www.bluestreamav.com.au/products

So this means, if you click on the "Products" root menu item directly without clicking on a link from drop-down, then it should take you to the "/products" url. But you need to click the Products Menu item twice to go to the "/products" url. This behaviour only happens when the parent menu item has drop-down contents.

To sum this up, I am not referring to the drop-down menu items at all. Instead I dont understand why does the Parent Menu item takes 2 clicks to go to the url when someone clicks on the parent item directly?

Does it make sense? Thanks again for looking into this.. cheers!
User avatar
Senior Boarder

teitbite
Wed Jun 18, 2014 8:27 pm
Reply with quote
Report this post
Hi

Yes I can see it now and I can also see an additional attribut for this menu option:

Code: Select all
dblclick="1403119319661"


There is no such element in our demo or in the copy I've installed. I think it may be comming from megamenu settings or some 3rd party plugin. So we know the cause of the problem, but still need to see Your site and login to panel to find a fix for it.
User avatar
Moderator

GK User
Thu Jun 19, 2014 9:30 am
Reply with quote
Report this post
Thanks for looking at it teitbite. If you had installed the quickstart package, you can reproduce the same by creating a new menu item linking to a category and then adding childcontent to it. Or try changing the "Game" menu item link (in the quickstart demo) from text separator and link it to a Joomla Category. When this is done, this parent menu will take 2 clicks. This happens in both quickstart and the standalone version of the template.
User avatar
Senior Boarder

teitbite
Sat Jun 21, 2014 12:49 pm
Reply with quote
Report this post
Hi

I had installed (in fact I have all our templates installed in any possible version for tests :) ) and checked it, but please look at the screen. As You can see Game menu option is linking to a category and has submenus at the same time, but there is no code for double click as You have it in Your site. I do not know what is causing it. Can be some 3rd party plugin or some new settings in joomla. I'll ask programmers and will let You know how to get rid of it.
User avatar
Moderator

teitbite
Sat Jun 21, 2014 1:30 pm
Reply with quote
Report this post
Hi

Got an answer. Looks like this option is in fact included, but should be used only on tablets, so problem is that Your site is wrongly recognised, becuase of newer jQuery version used. Tablets got bigger nowadays so the desktop size got a similar width and jQuery got updated with this informations. To fix it please edit: /js/gk.menu.js and remove this code:

Code: Select all
            if(el.parent().hasClass('haschild') && jQuery(document.body).attr('data-tablet') !== null) {
                el.click(function(e) {
                    if(el.attr("dblclick") === undefined) {
                        e.preventDefault();
                        e.stopPropagation();
                        el.attr("dblclick", new Date().getTime());
                    } else {
                  if(el.parent().find('div.childcontent').eq(0).css('overflow') == 'visible') {
                     window.location = el.attr('href');
                  }
                        var now = new Date().getTime();
                        if(now - el.attr("dblclick", 0) < 500) {
                            window.location = el.attr('href');
                        } else {
                           e.preventDefault();
                           e.stopPropagation();
                           el.attr("dblclick", new Date().getTime());
                        }
                    }
                });
            }


it starts in line 13.
User avatar
Moderator

GK User
Wed Jun 25, 2014 5:03 pm
Reply with quote
Report this post
Hi teitbite,

Sorry for the delay in my response. Its been a very busy week and couldnt login here for awhile.

Thank you so much for finding out what was the cause of it and for explaining the reason. It makes sense now. I added the fix in gk.menu.js by commenting the lines and now menu items works the way I wanted (parent item opens in single click).

Thanks again teitbite. I was gonna scrape the drop-down menu due to the double clicks, but now I may not have to. Owe you one... :)
User avatar
Senior Boarder

teitbite
Fri Jun 27, 2014 9:44 pm
Reply with quote
Report this post
Hi

No problem. Glad I could help :) Also for anyone else who may need it. Fix will be included into the template package soon.
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.