Skip to content
Permalink
Browse files

Dialog: Prevent the titlebar from displaying above the top of the doc…

…ument.

Fixes #5141 - Position of Dialog is off the page when viewport is smaller then dialog.
  • Loading branch information
scottgonzalez committed Feb 6, 2010
1 parent 267e978 commit f2a9deb611332776e126cb847de4c5d577c413ef
Showing with 8 additions and 1 deletion.
  1. +8 −1 ui/jquery.ui.dialog.js
@@ -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();

0 comments on commit f2a9deb

Please sign in to comment.
You can’t perform that action at this time.