]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Add unit test to cover #8789 and #8838.
authorKris Borchers <kris.borchers@gmail.com>
Sun, 25 Nov 2012 05:18:51 +0000 (23:18 -0600)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Mon, 26 Nov 2012 11:14:29 +0000 (12:14 +0100)
tests/unit/dialog/dialog_events.js

index eeb17eb93bc1e96b8ecdb5ad361f8e787057b695..cbeced0f8802ce3b9aadab86d43b9731c59a7df4 100644 (file)
@@ -325,4 +325,20 @@ test("beforeClose", function() {
        el.remove();
 });
 
+// #8789 and #8838
+asyncTest("ensure dialog's container doesn't scroll on resize and focus", function() {
+       expect(2);
+
+       var el = $('#dialog1').dialog(),
+               initialScroll = $(window).scrollTop();
+       el.dialog('option', 'height', 600);
+       equal($(window).scrollTop(), initialScroll, "scroll hasn't moved after height change");
+       setTimeout( function(){
+               $(".ui-dialog-titlebar-close").simulate('mousedown');
+               equal($(window).scrollTop(), initialScroll, "scroll hasn't moved after focus moved to dialog");
+               el.dialog('destroy');
+               start();
+       }, 500);
+});
+
 })(jQuery);