sometimes a dialog's size was stuck after moving it around
This commit is contained in:
@ -93,6 +93,15 @@ window.dialog = function(options) {
|
||||
}
|
||||
}
|
||||
|
||||
// there seems to be a bug where width/height are set to a fixed value after moving a dialog
|
||||
function sizeFix() {
|
||||
if(dialog.data('collapsed')) return;
|
||||
|
||||
var options = dialog.dialog('option');
|
||||
dialog.dialog('option', 'height', options.height);
|
||||
dialog.dialog('option', 'width', options.width);
|
||||
}
|
||||
|
||||
// Create the window, appending a div to the body
|
||||
$('body').append('<div id="' + id + '"></div>');
|
||||
var dialog = $(jqID).dialog($.extend(true, {
|
||||
@ -140,7 +149,8 @@ window.dialog = function(options) {
|
||||
var button = dialog.find('.ui-dialog-titlebar-button-collapse');
|
||||
|
||||
// Slide toggle
|
||||
$(selector).slideToggle({duration: window.DIALOG_SLIDE_DURATION});
|
||||
$(this).css('height', '');
|
||||
$(selector).slideToggle({duration: window.DIALOG_SLIDE_DURATION, complete: sizeFix});
|
||||
|
||||
if(collapsed) {
|
||||
$(button).removeClass('ui-dialog-titlebar-button-collapse-collapsed');
|
||||
@ -214,6 +224,8 @@ window.dialog = function(options) {
|
||||
}
|
||||
}, options));
|
||||
|
||||
dialog.on('dialogdragstop dialogresizestop', sizeFix);
|
||||
|
||||
// Set HTML and IDs
|
||||
dialog.html(html);
|
||||
dialog.data('id', id);
|
||||
|
Reference in New Issue
Block a user