]> source.dussan.org Git - jquery-ui.git/commitdiff
Position: Patch .offset( fn ) setter for jQuery 1.3.2. Fixes #8254 - Position module...
authorScott González <scott.gonzalez@gmail.com>
Tue, 8 May 2012 21:44:59 +0000 (17:44 -0400)
committerScott González <scott.gonzalez@gmail.com>
Tue, 8 May 2012 21:44:59 +0000 (17:44 -0400)
ui/jquery.ui.position.js

index 2d0f5488d6e07440e631b9687b21df4a1fbbb819..25d9ce8a47cd63a2d2e3a1a4e33d4d658a4f1861 100644 (file)
@@ -243,7 +243,12 @@ if ( !$.offset.setOffset ) {
        $.fn.offset = function( options ) {
                var elem = this[ 0 ];
                if ( !elem || !elem.ownerDocument ) { return null; }
-               if ( options ) { 
+               if ( options ) {
+                       if ( $.isFunction( options ) ) {
+                               return this.each(function( i ) {
+                                       $( this ).offset( options.call( this, i, $( this ).offset() ) );
+                               });
+                       }
                        return this.each(function() {
                                $.offset.setOffset( this, options );
                        });