mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Merge branch 'master' of github.com:jquery/jquery-ui
This commit is contained in:
commit
c49be0be1a
@ -43,5 +43,9 @@
|
|||||||
|
|
||||||
<div style="position: absolute; height: 5000px; width: 5000px;"></div>
|
<div style="position: absolute; height: 5000px; width: 5000px;"></div>
|
||||||
|
|
||||||
|
<div id="bug-5280" style="height: 30px; width: 201px;">
|
||||||
|
<div style="width: 50px; height: 10px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -330,4 +330,22 @@ test("collision: none, with offset", function() {
|
|||||||
}, { top: -13, left: -12 }, "left top, negative offset");
|
}, { top: -13, left: -12 }, "left top, negative offset");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//test('bug #5280: consistent results (avoid fractional values)', function() {
|
||||||
|
// var wrapper = $('#bug-5280'),
|
||||||
|
// elem = wrapper.children(),
|
||||||
|
// offset1 = elem.position({
|
||||||
|
// my: 'center',
|
||||||
|
// at: 'center',
|
||||||
|
// of: wrapper,
|
||||||
|
// collision: 'none'
|
||||||
|
// }).offset(),
|
||||||
|
// offset2 = elem.position({
|
||||||
|
// my: 'center',
|
||||||
|
// at: 'center',
|
||||||
|
// of: wrapper,
|
||||||
|
// collision: 'none'
|
||||||
|
// }).offset();
|
||||||
|
// same(offset1, offset2);
|
||||||
|
//});
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
4
ui/jquery.ui.position.js
vendored
4
ui/jquery.ui.position.js
vendored
@ -113,6 +113,10 @@ $.fn.position = function( options ) {
|
|||||||
position.top -= elemHeight / 2;
|
position.top -= elemHeight / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// prevent fractions (see #5280)
|
||||||
|
position.left = parseInt( position.left );
|
||||||
|
position.top = parseInt( position.top );
|
||||||
|
|
||||||
$.each( [ "left", "top" ], function( i, dir ) {
|
$.each( [ "left", "top" ], function( i, dir ) {
|
||||||
if ( $.ui.position[ collision[i] ] ) {
|
if ( $.ui.position[ collision[i] ] ) {
|
||||||
$.ui.position[ collision[i] ][ dir ]( position, {
|
$.ui.position[ collision[i] ][ dir ]( position, {
|
||||||
|
Loading…
Reference in New Issue
Block a user