diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gallery.common.js | 15 | ||||
-rw-r--r-- | lib/gallery.dialog.js | 8 |
2 files changed, 11 insertions, 12 deletions
diff --git a/lib/gallery.common.js b/lib/gallery.common.js index a959d90d..c6a619c1 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -140,19 +140,18 @@ /* after scaling the width, check that the height fits */ if (imageHeight > height) { - ratio = height / imageHeight; - imageWidth *= ratio; - imageHeight *= ratio; + ratio = height / imageHeight; + imageWidth *= ratio; + imageHeight *= ratio; } // handle the case where the calculation is almost zero (2.14e-14) return { - top: Number((height - imageHeight) / 2), - left: Number((width - imageWidth) / 2), - width: Number(imageWidth), - height: Number(imageHeight) + top: Number((height - imageHeight) / 2), + left: Number((width - imageWidth) / 2), + width: Number(imageWidth), + height: Number(imageHeight) }; }; })(jQuery); - diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index ace588f6..d1ea3edf 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -30,7 +30,7 @@ $("#gDialog").html(data).gallery_show_loading(); if ($("#gDialog form").length) { - self._trigger("form_loaded", null, $("#gDialog form")); + self.form_loaded(null, $("#gDialog form")); } self._layout(); @@ -70,7 +70,7 @@ $("#gDialog").dialog('option', 'width', dialogWidth); }, - form_loaded: function event(event, ui) { + form_loaded: function(event, ui) { // Should be defined (and localized) in the theme MSG_CANCEL = MSG_CANCEL || 'Cancel'; var eCancel = '<a href="#" class="gCancel">' + MSG_CANCEL + '</a>'; @@ -78,7 +78,7 @@ $("#gDialog .submit").addClass("ui-state-default ui-corner-all"); $("#gDialog .submit").parent().append(eCancel); $("#gDialog .gCancel").click(function(event) { - $("gDialog").dialog("close"); + $("#gDialog").dialog("close"); event.preventDefault(); }); } @@ -92,7 +92,7 @@ ); }, - close_dialog: function (event, ui) { + close_dialog: function(event, ui) { var self = $("#gDialog").dialog("option", "self"); if ($("#gDialog form").length) { self._trigger("form_closing", null, $("#gDialog form")); |