]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Updated test for default position option. QUnit still fails the test though.
authorScott González <scott.gonzalez@gmail.com>
Wed, 14 Jul 2010 20:38:16 +0000 (16:38 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 14 Jul 2010 20:40:43 +0000 (16:40 -0400)
tests/unit/dialog/dialog_defaults.js

index 999021d952775009b5e7143112fc8181f3d85449..cba514fe774c7e03725a7ce9416bc72f98e2eb09 100644 (file)
@@ -17,7 +17,19 @@ var dialog_defaults = {
        minHeight: 150,
        minWidth: 150,
        modal: false,
-       position: 'center',
+       position: {
+               my: 'center',
+               at: 'center',
+               of: window,
+               collision: 'fit',
+               // ensure that the titlebar is never outside the document
+               using: function(pos) {
+                       var topOffset = $(this).css(pos).offset().top;
+                       if (topOffset < 0) {
+                               $(this).css('top', pos.top - topOffset);
+                       }
+               }
+       },
        resizable: true,
        show: null,
        stack: true,