Update web2py_bootstrap.js

This allows dropdown menu items to be open in the target specified if it exists without changing main/top window
This commit is contained in:
Kelvin Spencer
2018-08-08 08:58:15 -05:00
committed by GitHub
parent 285013a64a
commit 46b8ad3fdd
@@ -29,5 +29,14 @@ jQuery(function(){
}
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');});
jQuery('ul.nav li.dropdown a').click(function(){
if(jQuery(this).attr("target")){
window.open(
jQuery(this).attr('href'),
jQuery(this).attr('target') // <- This is what makes it open in a new window.
);
} else {
window.location=jQuery(this).attr('href');
}
});
});