Skip to content

Commit 3cf2b7c

Browse files
committed
Position: Patch .offset( fn ) setter for jQuery 1.3.2. Fixes #8254 - Position module throws uncaught exception on IE8 with jQuery 1.3.2.
1 parent b676d59 commit 3cf2b7c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ui/jquery.ui.position.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,12 @@ if ( !$.offset.setOffset ) {
243243
$.fn.offset = function( options ) {
244244
var elem = this[ 0 ];
245245
if ( !elem || !elem.ownerDocument ) { return null; }
246-
if ( options ) {
246+
if ( options ) {
247+
if ( $.isFunction( options ) ) {
248+
return this.each(function( i ) {
249+
$( this ).offset( options.call( this, i, $( this ).offset() ) );
250+
});
251+
}
247252
return this.each(function() {
248253
$.offset.setOffset( this, options );
249254
});

0 commit comments

Comments
 (0)