summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChad Kieffer <ckieffer@gmail.com>2009-08-28 13:48:54 -0600
committerChad Kieffer <ckieffer@gmail.com>2009-08-28 13:48:54 -0600
commit5a2853bca1ea9a9231e01814df9aa373bf50d19c (patch)
tree431264bfb9de1d8bbdc6a9ba7775a363381f96e8 /lib
parentf1e008a14f2dfb51d1204dad3deb19e2e3df16c8 (diff)
parent6dcfdb6432d556f43736d60de8f310f247868bfa (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'lib')
-rw-r--r--lib/gallery.dialog.js8
-rw-r--r--lib/gallery.show_full_size.js35
2 files changed, 23 insertions, 20 deletions
diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js
index 4bbb8ab7..ace588f6 100644
--- a/lib/gallery.dialog.js
+++ b/lib/gallery.dialog.js
@@ -56,10 +56,14 @@
var dialogHeight = $("#gDialog").height();
var cssWidth = new String($("#gDialog form").css("width"));
var childWidth = cssWidth.replace(/[^0-9]/g,"");
+ var size = $.gallery_get_viewport_size();
if ($("#gDialog iframe").length) {
- dialogWidth = $(window).width() - 100;
+ dialogWidth = size.width() - 100;
// Set the iframe width and height
- $("#gDialog iframe").width("100%").height($(window).height() - 100);
+ $("#gDialog iframe").width("100%").height(size.height() - 100);
+ } else if ($("#gDialog .gDialogPanel").length) {
+ dialogWidth = size.width() - 100;
+ $("#gDialog").dialog("option", "height", size.height() - 100);
} else if (childWidth == "" || childWidth > 300) {
dialogWidth = 500;
}
diff --git a/lib/gallery.show_full_size.js b/lib/gallery.show_full_size.js
index 2f365f0d..7e826c32 100644
--- a/lib/gallery.show_full_size.js
+++ b/lib/gallery.show_full_size.js
@@ -10,7 +10,7 @@
$("body").append('<div id="gFullsizeOverlay" class="ui-dialog-overlay" ' +
'style="border: none; margin: 0; padding: 0; background-color: #000; ' +
'position: absolute; top: 0px; left: 0px; ' +
- 'width: ' + size.width() + 'px; height: ' + size.height() + 'px;' +
+ 'width: ' + width + 'px; height: ' + height + 'px;' +
' opacity: 0.7; filter: alpha(opacity=70);' +
'-moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; ' +
'-moz-background-inline-policy: -moz-initial; z-index: 1001;"> </div>');
@@ -27,23 +27,22 @@
'<img id="gFullSizeImage" src="' + image_url + '"' +
'height="' + image_size.height + '" width="' + image_size.width + '"/></div>');
- $("#gFullsize").append('<span id="gFullsizeClose" class="fg-button ui-icon ui-state-default ' +
- 'ui-icon-closethick ui-corner-all" style="z-index: 1003; position: absolute; ' +
- 'right: 1em; top: 1em;"></span>');
- $("#gFullsizeClose").click(function() {
- $("#gFullsizeOverlay*").remove();
- $("#gFullsize").remove();
- });
+ $().click(function() {
+ $("#gFullsizeOverlay*").remove();
+ $("#gFullsize").remove();
+ });
+ $().bind("keypress", function() {
+ $("#gFullsizeOverlay*").remove();
+ $("#gFullsize").remove();
+ });
$(window).resize(function() {
- $("#gFullsizeOverlay").width($(document).width())
- .height($(document).height());
- image_size = $.gallery_auto_fit_window(image_width, image_height);
- $("#gFullsize").height(image_size.height)
- .width(image_size.width)
- .css("top", image_size.top)
- .css("left", image_size.left);
- $("#gFullSizeImage").height(image_size.height)
- .width(image_size.width);
- });
+ $("#gFullsizeOverlay").width($(document).width()).height($(document).height());
+ image_size = $.gallery_auto_fit_window(image_width, image_height);
+ $("#gFullsize").height(image_size.height)
+ .width(image_size.width)
+ .css("top", image_size.top)
+ .css("left", image_size.left);
+ $("#gFullSizeImage").height(image_size.height).width(image_size.width);
+ });
};
})(jQuery);