new web2py_bootstrap.js, thanks Paolo Caruccio
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -8,21 +8,28 @@ jQuery(function(){
|
|||||||
if(jQuery(this).find('ul').length)
|
if(jQuery(this).find('ul').length)
|
||||||
jQuery(this).addClass('dropdown-submenu');
|
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(){
|
function hoverMenu(){
|
||||||
var wid = document.documentElement.clientWidth; //faster than $(window).width() and cross browser
|
jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){
|
||||||
if (wid>=980){
|
adjust_height_of_collapsed_nav();
|
||||||
jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){
|
mi = jQuery(this).addClass('open');
|
||||||
mi = jQuery(this).addClass('open');
|
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400);
|
||||||
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400);
|
}, function(){
|
||||||
}, function(){
|
mi = jQuery(this);
|
||||||
mi = jQuery(this);
|
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')});
|
||||||
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')});
|
});
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
hoverMenu(); // first page load
|
hoverMenu(); // first page load
|
||||||
jQuery(window).resize(hoverMenu); // on resize event
|
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(){window.location=jQuery(this).attr('href');});
|
||||||
// make all buttons bootstrap buttons
|
// make all buttons bootstrap buttons
|
||||||
jQuery('button, form input[type="submit"], form input[type="button"]').addClass('btn');
|
jQuery('button, form input[type="submit"], form input[type="button"]').addClass('btn');
|
||||||
});
|
});
|
||||||
@@ -8,21 +8,28 @@ jQuery(function(){
|
|||||||
if(jQuery(this).find('ul').length)
|
if(jQuery(this).find('ul').length)
|
||||||
jQuery(this).addClass('dropdown-submenu');
|
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(){
|
function hoverMenu(){
|
||||||
var wid = document.documentElement.clientWidth; //faster than $(window).width() and cross browser
|
jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){
|
||||||
if (wid>=980){
|
adjust_height_of_collapsed_nav();
|
||||||
jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){
|
mi = jQuery(this).addClass('open');
|
||||||
mi = jQuery(this).addClass('open');
|
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400);
|
||||||
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400);
|
}, function(){
|
||||||
}, function(){
|
mi = jQuery(this);
|
||||||
mi = jQuery(this);
|
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')});
|
||||||
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')});
|
});
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
hoverMenu(); // first page load
|
hoverMenu(); // first page load
|
||||||
jQuery(window).resize(hoverMenu); // on resize event
|
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(){window.location=jQuery(this).attr('href');});
|
||||||
// make all buttons bootstrap buttons
|
// make all buttons bootstrap buttons
|
||||||
jQuery('button, form input[type="submit"], form input[type="button"]').addClass('btn');
|
jQuery('button, form input[type="submit"], form input[type="button"]').addClass('btn');
|
||||||
});
|
});
|
||||||
@@ -8,21 +8,28 @@ jQuery(function(){
|
|||||||
if(jQuery(this).find('ul').length)
|
if(jQuery(this).find('ul').length)
|
||||||
jQuery(this).addClass('dropdown-submenu');
|
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(){
|
function hoverMenu(){
|
||||||
var wid = document.documentElement.clientWidth; //faster than $(window).width() and cross browser
|
jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){
|
||||||
if (wid>=980){
|
adjust_height_of_collapsed_nav();
|
||||||
jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){
|
mi = jQuery(this).addClass('open');
|
||||||
mi = jQuery(this).addClass('open');
|
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400);
|
||||||
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400);
|
}, function(){
|
||||||
}, function(){
|
mi = jQuery(this);
|
||||||
mi = jQuery(this);
|
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')});
|
||||||
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')});
|
});
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
hoverMenu(); // first page load
|
hoverMenu(); // first page load
|
||||||
jQuery(window).resize(hoverMenu); // on resize event
|
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(){window.location=jQuery(this).attr('href');});
|
||||||
// make all buttons bootstrap buttons
|
// make all buttons bootstrap buttons
|
||||||
jQuery('button, form input[type="submit"], form input[type="button"]').addClass('btn');
|
jQuery('button, form input[type="submit"], form input[type="button"]').addClass('btn');
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user