Skip to content

Dialog & Resizable styles fixed NE,SE,S,E handles. Fixed #9521 ui.Dialog... #1092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/unit/dialog/dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script src="../testsuite.js"></script>
<script>
TestHelpers.loadResources({
css: [ "ui.core", "ui.dialog" ],
css: [ "ui.core", "ui.dialog", "ui.resizable" ],
js: [
"ui/jquery.ui.core.js",
"ui/jquery.ui.widget.js",
Expand Down
40 changes: 40 additions & 0 deletions tests/unit/dialog/dialog_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,46 @@ test( "#7960: resizable handles below modal overlays", function() {
dialog.dialog( "destroy" );
});

test( "#9521: Dialog: Resiable dialogs move/resize out of viewpoint boundry", function() {
expect( 2 );
var doc = {},
dialogWithNoResize = {},
dialogWithResize = {},
delta = {},
elementWithNoResize = $( "<div></div>" ).dialog({ resizable:false }),
elementWithResize = $( "<div></div>" ).dialog({ resizable:true }),
handleWithNoResize = $( ".ui-dialog-titlebar", elementWithNoResize.dialog( "widget" )),
handleWithResize = $( ".ui-dialog-titlebar", elementWithResize.dialog( "widget" )),
initialScroll = $( window ).scrollTop();

// Dialog with NO Resize Handles
doc.height = $( document ).height();
doc.width = $( document ).width();
dialogWithNoResize.height = elementWithNoResize.outerHeight();
dialogWithNoResize.width = elementWithNoResize.outerWidth();
delta.width = doc.width - dialogWithNoResize.width;
delta.height = doc.height - dialogWithNoResize.height;

elementWithNoResize.offset({ top: 0, left: 0 });
TestHelpers.dialog.drag( elementWithNoResize, handleWithNoResize, delta.width, delta.height );

equal( $(window).scrollTop(), initialScroll, "Draggable with no resize - no scrollbar after drag" );

// Dialog with Resize Handles
elementWithResize.offset({ top: 0, left: 0 });
dialogWithResize.height = elementWithResize.outerHeight();
dialogWithResize.width = elementWithResize.outerWidth();
delta.width = doc.width - dialogWithResize.width;
delta.height = doc.height - dialogWithResize.height;

TestHelpers.dialog.drag( elementWithResize, handleWithResize, delta.width, delta.height );

equal( $(window).scrollTop(), initialScroll, "Draggable with resize - no scrollbar after drag" );

elementWithNoResize.remove();
elementWithResize.remove();
});

asyncTest( "Prevent tabbing out of dialogs", function() {
expect( 3 );

Expand Down
8 changes: 4 additions & 4 deletions themes/base/jquery.ui.dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
cursor: pointer;
}
.ui-dialog .ui-resizable-se {
width: 12px;
height: 12px;
right: -5px;
bottom: -5px;
width: 7px;
height: 7px;
right: 0;
bottom: 0;
background-position: 16px 16px;
}
.ui-draggable .ui-dialog-titlebar {
Expand Down
26 changes: 13 additions & 13 deletions themes/base/jquery.ui.resizable.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
}
.ui-resizable-s {
cursor: s-resize;
height: 7px;
height: 4px;
width: 100%;
bottom: -5px;
bottom: 0;
left: 0;
}
.ui-resizable-e {
cursor: e-resize;
width: 7px;
right: -5px;
width: 4px;
right: 0;
top: 0;
height: 100%;
}
Expand All @@ -48,17 +48,17 @@
}
.ui-resizable-se {
cursor: se-resize;
width: 12px;
height: 12px;
right: 1px;
bottom: 1px;
width: 11px;
height: 11px;
right: 0;
bottom: 0;
}
.ui-resizable-sw {
cursor: sw-resize;
width: 9px;
height: 9px;
left: -5px;
bottom: -5px;
bottom: 0;
}
.ui-resizable-nw {
cursor: nw-resize;
Expand All @@ -69,8 +69,8 @@
}
.ui-resizable-ne {
cursor: ne-resize;
width: 9px;
height: 9px;
right: -5px;
top: -5px;
width: 6px;
height: 6px;
right: 0;
top: 0;
}