aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/dialog
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-12-03 09:14:27 -0500
committerScott González <scott.gonzalez@gmail.com>2010-12-03 09:14:27 -0500
commit22cf318e40e0ee1996ac27d8877ef2ec19e84ca2 (patch)
tree4b5e812396eb366b73cf762ec98aa21fb054d9a1 /tests/unit/dialog
parent51695f82c8c0017d3853b36bdadec5c8253648fb (diff)
downloadjquery-ui-22cf318e40e0ee1996ac27d8877ef2ec19e84ca2.tar.gz
jquery-ui-22cf318e40e0ee1996ac27d8877ef2ec19e84ca2.zip
Dialog position tests: Use Math.round() instead of Math.floor().
Diffstat (limited to 'tests/unit/dialog')
-rw-r--r--tests/unit/dialog/dialog_options.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit/dialog/dialog_options.js b/tests/unit/dialog/dialog_options.js
index ac457d9b2..82f28bf85 100644
--- a/tests/unit/dialog/dialog_options.js
+++ b/tests/unit/dialog/dialog_options.js
@@ -265,8 +265,8 @@ test("position, default center on window", function() {
var el = $('<div></div>').dialog();
var dialog = el.dialog('widget');
var offset = dialog.offset();
- same(offset.left, Math.floor($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft());
- same(offset.top, Math.floor($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop());
+ same(offset.left, Math.round($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft());
+ same(offset.top, Math.round($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop());
el.remove();
});
@@ -274,7 +274,7 @@ test("position, top on window", function() {
var el = $('<div></div>').dialog({ position: "top" });
var dialog = el.dialog('widget');
var offset = dialog.offset();
- same(offset.left, Math.floor($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft());
+ same(offset.left, Math.round($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft());
same(offset.top, $(window).scrollTop());
el.remove();
});
@@ -284,7 +284,7 @@ test("position, left on window", function() {
var dialog = el.dialog('widget');
var offset = dialog.offset();
same(offset.left, 0);
- same(offset.top, Math.floor($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop());
+ same(offset.top, Math.round($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop());
el.remove();
});