Bug 7931; cleaned up white space in accordance to style guide

This commit is contained in:
Xavi 2011-01-18 12:40:07 -05:00
parent 0942b3b3f5
commit 135a384cf3

View file

@ -260,15 +260,15 @@ jQuery.fn.extend({
jQuery.each( ["Left", "Top"], function( i, name ) { jQuery.each( ["Left", "Top"], function( i, name ) {
var method = "scroll" + name; var method = "scroll" + name;
jQuery.fn[ method ] = function(val) { jQuery.fn[ method ] = function( val ) {
var elem, win; var elem, win;
if(val === undefined) { if( val === undefined ) {
elem = this[0]; elem = this[ 0 ];
if( !elem ) { if( !elem ) {
return null; return null;
} }
win = getWindow( elem ); win = getWindow( elem );
// Return the scroll offset // Return the scroll offset
return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] : return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
@ -276,17 +276,16 @@ jQuery.each( ["Left", "Top"], function( i, name ) {
win.document.body[ method ] : win.document.body[ method ] :
elem[ method ]; elem[ method ];
} }
// Set the scroll offset // Set the scroll offset
return this.each(function() { return this.each(function() {
win = getWindow( this ); win = getWindow( this );
if ( win ) { if ( win ) {
win.scrollTo( win.scrollTo(
!i ? val : jQuery(win).scrollLeft(), !i ? val : jQuery( win ).scrollLeft(),
i ? val : jQuery(win).scrollTop() i ? val : jQuery( win ).scrollTop()
); );
} else { } else {
this[ method ] = val; this[ method ] = val;
} }