|
define( [ |
|
"../data/var/dataPriv" |
|
], function( dataPriv ) { |
|
|
|
function showHide( elements, show ) { |
|
var display, elem, |
|
values = [], |
|
index = 0, |
|
length = elements.length; |
|
|
|
|
|
for ( ; index < length; index++ ) { |
|
elem = elements[ index ]; |
|
if ( !elem.style ) { |
|
continue; |
|
} |
|
|
|
display = elem.style.display; |
|
if ( show ) { |
|
if ( display === "none" ) { |
|
|
|
|
|
values[ index ] = dataPriv.get( elem, "display" ) || ""; |
|
} |
|
} else { |
|
if ( display !== "none" ) { |
|
values[ index ] = "none"; |
|
|
|
|
|
dataPriv.set( elem, "display", display ); |
|
} |
|
} |
|
} |
|
|
|
|
|
|
|
for ( index = 0; index < length; index++ ) { |
|
if ( values[ index ] != null ) { |
|
elements[ index ].style.display = values[ index ]; |
|
} |
|
} |
|
|
|
return elements; |
|
} |
|
|
|
return showHide; |
|
|
|
} ); |
|
|