From 3cf2b7c45facd0e01edbaeec74082382f1da1499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 8 May 2012 17:44:59 -0400 Subject: [PATCH] Position: Patch .offset( fn ) setter for jQuery 1.3.2. Fixes #8254 - Position module throws uncaught exception on IE8 with jQuery 1.3.2. --- ui/jquery.ui.position.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index 2d0f5488d6e..25d9ce8a47c 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -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 ); });