id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blocking	blockedby
8488	.toggle( showOrHide ) is not consistent with documentation	kellyselden		"the documentation says it is the equivalent to

{{{
if (showOrHide) {
  $('#foo').show();
} else {
  $('#foo').hide();
}
}}}

but if showOrHide = 1, toggle will not show it because it is checking for a boolean type at line 7498 in jquery 1.5.1

{{{
toggle: function( fn, fn2, callback ) {
    var bool = typeof fn === ""boolean"";
}}}

my simplified code looks something like this when i ran into the problem:

{{{
function toggleSection(show) {
    //bunch of stuff based on show
    $('.something1').toggle(show);
}

toggleSection($('.something2:checked').length);
}}}

my work-around is to always remember to check against true

{{{
$('.something1').toggle(show == true);
}}}"	bug	closed	undecided	1.next	unfiled	1.5.1	fixed				
