summaryrefslogtreecommitdiff
path: root/lib/gallery.dialog.js
diff options
context:
space:
mode:
authorshadlaws <shad@shadlaws.com>2013-02-15 19:31:20 +0100
committershadlaws <shad@shadlaws.com>2013-02-15 19:31:20 +0100
commit4dd7b708b24a40ed90ed324d9853aa87b3ec46a0 (patch)
treef926aded5a3bedf07a75ac3f9e8a2da4963e4f22 /lib/gallery.dialog.js
parent96a01c86d9bd15f9dc91c60be6f236deab2ffad9 (diff)
Dialog sizing, titles, and z-index. This should ensure the small <500px dialogs
are correct, all titles are correctly sized, and the dialog boxes go to the top for older themes, too.
Diffstat (limited to 'lib/gallery.dialog.js')
-rw-r--r--lib/gallery.dialog.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js
index b4557493..a771adcb 100644
--- a/lib/gallery.dialog.js
+++ b/lib/gallery.dialog.js
@@ -28,9 +28,6 @@
$("#g-dialog").dialog("close");
}
$("body").append(eDialog);
- if (!self.options.zIndex) {
- self.options.zIndex = 9999;
- }
if (!self.options.close) {
self.options.close = self.close_dialog;
@@ -79,8 +76,7 @@
_layout: function() {
var dialogWidth;
var dialogHeight = $("#g-dialog").height();
- var cssWidth = new String($("#g-dialog form").css("width"));
- var childWidth = cssWidth.replace(/[^0-9]/g,"");
+ var childWidth = $("#g-dialog form").width();
var size = $.gallery_get_viewport_size();
if ($("#g-dialog iframe").length) {
dialogWidth = size.width() - 100;
@@ -89,8 +85,10 @@
} else if ($("#g-dialog .g-dialog-panel").length) {
dialogWidth = size.width() - 100;
$("#g-dialog").dialog("option", "height", size.height() - 100);
- } else {
+ } else if (childWidth <= 150 || childWidth > 300) {
dialogWidth = 500;
+ } else {
+ dialogWidth = 300;
}
$("#g-dialog").dialog('option', 'width', dialogWidth);
},
@@ -183,6 +181,7 @@
} else if ($("#g-dialog fieldset legend").length) {
$("#g-dialog").dialog('option', 'title', $("#g-dialog fieldset legend:eq(0)").html());
}
+ $(".ui-dialog-title").width('auto');
},
form_closing: function(event, ui) {},