Dimensions: allow modification of coordinates argument

Ref f7e60dc83d
This commit is contained in:
Oleg Gaidarenko
2014-11-11 16:27:44 +03:00
parent 38ac3c43ff
commit 1eedf0e9ea
2 changed files with 15 additions and 1 deletions

View File

@@ -470,4 +470,16 @@ testIframe( "dimensions/documentLarge", "window vs. large document", function( j
ok( jQuery( document ).width() > jQuery( window ).width(), "document width is larger than window width" );
});
test( "allow modification of coordinates argument (gh-1848)", 1, function() {
var element = jQuery( "<div/>" ).appendTo( "#qunit-fixture" );
element.offset(function( index, coords ) {
coords.top = 100;
return coords;
});
equal( element.offset().top, 100, "coordinates are modified" );
});
})();