mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Dialog: Prevent the titlebar from displaying above the top of the document.
Fixes #5141 - Position of Dialog is off the page when viewport is smaller then dialog.
This commit is contained in:
parent
267e9780c3
commit
f2a9deb611
9
ui/jquery.ui.dialog.js
vendored
9
ui/jquery.ui.dialog.js
vendored
@ -445,7 +445,14 @@ $.widget("ui.dialog", {
|
||||
at: myAt.join(' '),
|
||||
offset: offset.join(' '),
|
||||
of: window,
|
||||
collision: 'fit'
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!isVisible) {
|
||||
this.uiDialog.hide();
|
||||
|
Loading…
Reference in New Issue
Block a user