Better soloution, override the containment option in the ui core:
_makeDraggable: function() {
var self = this,
options = this.options,
heightBeforeDrag;
this.uiDialog.draggable({
cancel: '.ui-dialog-content',
handle: '.ui-dialog-titlebar',
containment: 'document', //override this HARD CODED option
start: function() {
heightBeforeDrag = options.height;
$(this).height($(this).height()).addClass("ui-dialog-dragging");
(options.dragStart && options.dragStart.apply(self.element[0], arguments));
},
drag: function() {
(options.drag && options.drag.apply(self.element[0], arguments));
},
stop: function() {
$(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);
(options.dragStop && options.dragStop.apply(self.element[0], arguments));
$.ui.dialog.overlay.resize();
}
});
I can't believe the developers hard coded this instead of providing the containment option. That's absolutely retarded.