From 46b8ad3fddfa6108ac4bec9d88d8c2088d324cd3 Mon Sep 17 00:00:00 2001 From: Kelvin Spencer Date: Wed, 8 Aug 2018 08:58:15 -0500 Subject: [PATCH] Update web2py_bootstrap.js This allows dropdown menu items to be open in the target specified if it exists without changing main/top window --- applications/admin/static/js/web2py_bootstrap.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/applications/admin/static/js/web2py_bootstrap.js b/applications/admin/static/js/web2py_bootstrap.js index 7206cb1b..abf6d1c7 100644 --- a/applications/admin/static/js/web2py_bootstrap.js +++ b/applications/admin/static/js/web2py_bootstrap.js @@ -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'); + } + }); });