Skip to content

Commit 0cd470b

Browse files
tjvantolljzaefferer
authored andcommitted
Resizable: Modified the default z-index value of resizable handles. Fixed #7960 - Dialog: Modal dialogs do not disable resizables on the page.
1 parent a68d5ca commit 0cd470b

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

tests/unit/resizable/resizable.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"ui/jquery.ui.core.js",
1717
"ui/jquery.ui.widget.js",
1818
"ui/jquery.ui.mouse.js",
19+
"ui/jquery.ui.button.js",
20+
"ui/jquery.ui.dialog.js",
1921
"ui/jquery.ui.resizable.js"
2022
]
2123
});

tests/unit/resizable/resizable_common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ TestHelpers.commonWidgetTests('resizable', {
1919
maxWidth: null,
2020
minHeight: 10,
2121
minWidth: 10,
22-
zIndex: 1000,
22+
zIndex: 90,
2323

2424
// callbacks
2525
create: null

tests/unit/resizable/resizable_options.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,18 @@ test("zIndex, applied to all handles", function() {
210210
});
211211
});
212212

213+
test( "zIndex, less than a modal dialog's overlay by default", function() {
214+
expect(1);
215+
216+
var resizable = $( '<div></div>' ).resizable();
217+
var dialog = $( '<div></div>' ).dialog( { modal: true });
218+
219+
var resizableZIndex = resizable.resizable( 'option', 'zIndex' );
220+
var overlayZIndex = $( '.ui-widget-overlay' ).css( 'zIndex' );
221+
overlayZIndex = parseInt( overlayZIndex, 10 );
222+
223+
ok( resizableZIndex < overlayZIndex, "Resizables behind a modal dialog must have a smaller z-index than the overlay so that they're not resizable. See #7960." );
224+
dialog.dialog( 'destroy' );
225+
});
226+
213227
})(jQuery);

ui/jquery.ui.resizable.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ $.widget("ui.resizable", $.ui.mouse, {
4242
maxWidth: null,
4343
minHeight: 10,
4444
minWidth: 10,
45-
zIndex: 1000
45+
// See #7960
46+
zIndex: 90
4647
},
4748
_create: function() {
4849

0 commit comments

Comments
 (0)