Merge "(bug 37301) add sizediff to list=usercontribs"
[lhc/web/wiklou.git] / resources / jquery.ui / jquery.ui.position.js
index 1989896..164804b 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * jQuery UI Position 1.8.20
+ * jQuery UI Position 1.8.21
  *
  * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
  * Dual licensed under the MIT or GPL Version 2 licenses.
@@ -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 );
                        });