[web2py] web2py menu and CTRL+Click redirect both actual and new tab

180 views
Skip to first unread message

Richard

unread,
Feb 25, 2015, 2:25:06 PM2/25/15
to web...@googlegroups.com
Hello,

I am not sure where is it from, but I notice and change in the behavior of CTRL + Click over main web2py menu and submenu entry which in the pass were only open an new tab conducting the user on the requested page base on menu entry link. But now, when doing CTRL + Click over menu and submenu entry new tab still get create and pointing over the proper location, but the actual page also get redirecting...

Any idea?

I will open a issue on github if you think that actually a regression issue?

Thanks

Richard

Dave S

unread,
Feb 25, 2015, 5:15:55 PM2/25/15
to web...@googlegroups.com


Past behavior  was  open top-level menu item, highlight entry for submenu, CTRL+click opens new tab which takes you to page corresponding to top-level item?

New behavior -- the tab opens as before, but the tab you started on also changes to that location?

/dps

Richard Vézina

unread,
Feb 26, 2015, 9:59:58 AM2/26/15
to web2py-users
YES, both tab get redirect to the link address which make useless the CTRL+Click...

It may be related to a missing .stopPropagation() jQuery related to some recent change, I start looking to commit history, but I really don't know where to check exactly. About .stopPropagation() : http://stackoverflow.com/questions/26167017/how-to-open-new-tab-with-ctrlclick-instead-of-redirect-current-tab-in-jquery

I maybe also completly wrong about .stopPropagartion()...

Richard
 

/dps

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Richard Vézina

unread,
Mar 3, 2015, 9:56:23 AM3/3/15
to web2py-users
Investigation, this issue is there since ever I guess... It comes from web2py_bootstrap.js and particularly these lines :

function hoverMenu(){
    jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){
        adjust_height_of_collapsed_nav();
        var mi = jQuery(this).addClass('open');
        mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400);
    }, function(){
        var mi = jQuery(this);
        mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')});
    });
  }
  hoverMenu(); // first page load
  jQuery(window).resize(hoverMenu); // on resize event
  jQuery('ul.nav li.dropdown a').click(function(){window.location=jQuery(this).attr('href');});

I use to comment these lines in my app because I use jquery.hoverIntent.minified.js to improve menu dropdown behavior... So I was not having the issue, but recently I update to 2.9.5 and forget to comment these lines so I am having the issue... 

It should come from the .click()...

I will try something...

Richard

Richard Vézina

unread,
Mar 3, 2015, 10:18:47 AM3/3/15
to web2py-users
I think I solved it : https://github.com/web2py/web2py/issues/829

Richard
Reply all
Reply to author
Forward
0 new messages