diff options
author | Bharat Mediratta <bharat@menalto.com> | 2013-02-14 11:45:43 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2013-02-14 11:45:43 -0800 |
commit | 16b8b8d16b8b46fe1e60b2a86f9ee5883dbc892f (patch) | |
tree | d164369706d633c84212881b7f85fe6fe5ee1919 /lib/gallery.dialog.js | |
parent | 7ef7759947779e27b9a2752512bfec34ebcde468 (diff) | |
parent | f580488fb5914b309a15396611d9b3a9177c65a0 (diff) |
Merge pull request #141 from shadlaws/jquery_19_dialog_sizing
Dialog centering, sizing, etc. seem to be fixed!
Diffstat (limited to 'lib/gallery.dialog.js')
-rw-r--r-- | lib/gallery.dialog.js | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index 80f4f81d..b4557493 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -1,5 +1,12 @@ (function($) { $.widget("ui.gallery_dialog", { + options: { + autoOpen: false, + autoResize: true, + modal: true, + resizable: false, + position: "center" + }, _init: function() { var self = this; if (!self.options.immediate) { @@ -82,7 +89,7 @@ } else if ($("#g-dialog .g-dialog-panel").length) { dialogWidth = size.width() - 100; $("#g-dialog").dialog("option", "height", size.height() - 100); - } else if (childWidth == "" || childWidth > 300) { + } else { dialogWidth = 500; } $("#g-dialog").dialog('option', 'width', dialogWidth); @@ -132,6 +139,13 @@ }, success: function(data) { if (data.html) { + if (data.result == "error") { + // This is an odd case that arises from the watermarks module. This is because we + // have a fake xhr, and we rawurlencode the results because the JS code that uploads + // the file buffers it in an iframe which entitizes the HTML and makes it difficult + // for the JS to process. See ticket #797. + data.html = unescape(data.html); + } $("#g-dialog").html(data.html); $("#g-dialog").dialog("option", "position", "center"); $("#g-dialog form :submit").removeClass("ui-state-disabled") @@ -174,14 +188,4 @@ form_closing: function(event, ui) {}, dialog_closing: function(event, ui) {} }); - - $.extend($.ui.gallery_dialog, { - defaults: { - autoOpen: false, - autoResize: true, - modal: true, - resizable: false, - position: "center" - } - }); })(jQuery); |