From bbe787b7b463225abcd917c38a94168d0942ca67 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Mon, 15 Apr 2013 17:58:45 -0500 Subject: [PATCH] new web2py_bootstrap.js, thanks Paolo Caruccio --- VERSION | 2 +- .../admin/static/js/web2py_bootstrap.js | 29 ++++++++++++------- .../examples/static/js/web2py_bootstrap.js | 29 ++++++++++++------- .../welcome/static/js/web2py_bootstrap.js | 29 ++++++++++++------- 4 files changed, 55 insertions(+), 34 deletions(-) diff --git a/VERSION b/VERSION index 2e40603d..57b96bd1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.6-stable+timestamp.2013.04.15.17.18.31 +Version 2.4.6-stable+timestamp.2013.04.15.17.58.03 diff --git a/applications/admin/static/js/web2py_bootstrap.js b/applications/admin/static/js/web2py_bootstrap.js index 4fe46472..0c94fd98 100644 --- a/applications/admin/static/js/web2py_bootstrap.js +++ b/applications/admin/static/js/web2py_bootstrap.js @@ -8,21 +8,28 @@ jQuery(function(){ if(jQuery(this).find('ul').length) jQuery(this).addClass('dropdown-submenu'); }); + function adjust_height_of_collapsed_nav() { + var cn = jQuery('div.collapse'); + if (cn.get(0)) { + var cnh = cn.get(0).style.height; + if (cnh>'0px'){ + cn.css('height','auto'); + } + } + } function hoverMenu(){ - var wid = document.documentElement.clientWidth; //faster than $(window).width() and cross browser - if (wid>=980){ - jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){ - mi = jQuery(this).addClass('open'); - mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400); - }, function(){ - mi = jQuery(this); - mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')}); - }); - }; + jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){ + adjust_height_of_collapsed_nav(); + mi = jQuery(this).addClass('open'); + mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400); + }, function(){ + 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');}); // make all buttons bootstrap buttons jQuery('button, form input[type="submit"], form input[type="button"]').addClass('btn'); -}); +}); \ No newline at end of file diff --git a/applications/examples/static/js/web2py_bootstrap.js b/applications/examples/static/js/web2py_bootstrap.js index 4fe46472..0c94fd98 100644 --- a/applications/examples/static/js/web2py_bootstrap.js +++ b/applications/examples/static/js/web2py_bootstrap.js @@ -8,21 +8,28 @@ jQuery(function(){ if(jQuery(this).find('ul').length) jQuery(this).addClass('dropdown-submenu'); }); + function adjust_height_of_collapsed_nav() { + var cn = jQuery('div.collapse'); + if (cn.get(0)) { + var cnh = cn.get(0).style.height; + if (cnh>'0px'){ + cn.css('height','auto'); + } + } + } function hoverMenu(){ - var wid = document.documentElement.clientWidth; //faster than $(window).width() and cross browser - if (wid>=980){ - jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){ - mi = jQuery(this).addClass('open'); - mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400); - }, function(){ - mi = jQuery(this); - mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')}); - }); - }; + jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){ + adjust_height_of_collapsed_nav(); + mi = jQuery(this).addClass('open'); + mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400); + }, function(){ + 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');}); // make all buttons bootstrap buttons jQuery('button, form input[type="submit"], form input[type="button"]').addClass('btn'); -}); +}); \ No newline at end of file diff --git a/applications/welcome/static/js/web2py_bootstrap.js b/applications/welcome/static/js/web2py_bootstrap.js index 4fe46472..0c94fd98 100644 --- a/applications/welcome/static/js/web2py_bootstrap.js +++ b/applications/welcome/static/js/web2py_bootstrap.js @@ -8,21 +8,28 @@ jQuery(function(){ if(jQuery(this).find('ul').length) jQuery(this).addClass('dropdown-submenu'); }); + function adjust_height_of_collapsed_nav() { + var cn = jQuery('div.collapse'); + if (cn.get(0)) { + var cnh = cn.get(0).style.height; + if (cnh>'0px'){ + cn.css('height','auto'); + } + } + } function hoverMenu(){ - var wid = document.documentElement.clientWidth; //faster than $(window).width() and cross browser - if (wid>=980){ - jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){ - mi = jQuery(this).addClass('open'); - mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400); - }, function(){ - mi = jQuery(this); - mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')}); - }); - }; + jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){ + adjust_height_of_collapsed_nav(); + mi = jQuery(this).addClass('open'); + mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400); + }, function(){ + 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');}); // make all buttons bootstrap buttons jQuery('button, form input[type="submit"], form input[type="button"]').addClass('btn'); -}); +}); \ No newline at end of file