aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/dialog/dialog_methods.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2013-09-27 18:53:15 +0200
committerJörn Zaefferer <joern.zaefferer@gmail.com>2013-10-02 17:02:28 +0200
commite263ebda99f3d414bae91a4a47e74a37ff93ba9c (patch)
treed69d4f892181ba5db1e3fdcbb2d7cb4dae9e4f6b /tests/unit/dialog/dialog_methods.js
parent80b17bb40a1a0956e954d41550ebdf69ee480ae2 (diff)
downloadjquery-ui-e263ebda99f3d414bae91a4a47e74a37ff93ba9c.tar.gz
jquery-ui-e263ebda99f3d414bae91a4a47e74a37ff93ba9c.zip
Dialog: Switch back to shuffling z-index, but only look at .ui-front siblings.
Fixes #9166 - Dialog: moveToTop implementation resets flash/video/iframe/scroll Fixes #9364 - Dialog: Click of element with tooltip scrolls the dialog to the top
Diffstat (limited to 'tests/unit/dialog/dialog_methods.js')
-rw-r--r--tests/unit/dialog/dialog_methods.js21
1 files changed, 17 insertions, 4 deletions
diff --git a/tests/unit/dialog/dialog_methods.js b/tests/unit/dialog/dialog_methods.js
index 60a7aa4d8..8918e8d36 100644
--- a/tests/unit/dialog/dialog_methods.js
+++ b/tests/unit/dialog/dialog_methods.js
@@ -144,8 +144,8 @@ test("moveToTop", function() {
expect( 5 );
function order() {
var actual = $( ".ui-dialog" ).map(function() {
- return +$( this ).find( ".ui-dialog-content" ).attr( "id" ).replace( /\D+/, "" );
- }).get().reverse();
+ return +$( this ).css( "z-index" );
+ }).get();
deepEqual( actual, $.makeArray( arguments ) );
}
var dialog1, dialog2,
@@ -161,10 +161,23 @@ test("moveToTop", function() {
equal( focusOn, "dialog2" );
}
});
- order( 2, 1 );
+ order( 100, 101 );
focusOn = "dialog1";
dialog1.dialog( "moveToTop" );
- order( 1, 2 );
+ order( 102, 101 );
+});
+
+test( "moveToTop: content scroll stays intact", function() {
+ expect( 2 );
+ var otherDialog = $( "#dialog1" ).dialog(),
+ scrollDialog = $( "#form-dialog" ).dialog({
+ height: 200
+ });
+ scrollDialog.scrollTop( 50 );
+ equal( scrollDialog.scrollTop(), 50 );
+
+ otherDialog.dialog( "moveToTop" );
+ equal( scrollDialog.scrollTop(), 50 );
});
test("open", function() {