summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/gallery.common.js30
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/gallery.common.js b/lib/gallery.common.js
index c6a619c1..81904548 100644
--- a/lib/gallery.common.js
+++ b/lib/gallery.common.js
@@ -112,21 +112,23 @@
};
$.fn.gallery_context_menu = function() {
- var in_progress = 0;
- $(".gContextMenu *").removeAttr('title');
- $(".gContextMenu ul").hide();
- $(".gContextMenu").hover(
- function() {
- if (in_progress == 0) {
- $(this).find("ul").slideDown("fast", function() { in_progress = 1; });
- $(this).find(".gDialogLink").gallery_dialog();
- $(this).find(".gAjaxLink").gallery_ajax();
+ if ($(".gContextMenu li").length) {
+ var in_progress = 0;
+ $(".gContextMenu *").removeAttr('title');
+ $(".gContextMenu ul").hide();
+ $(".gContextMenu").hover(
+ function() {
+ if (in_progress == 0) {
+ $(this).find("ul").slideDown("fast", function() { in_progress = 1; });
+ $(this).find(".gDialogLink").gallery_dialog();
+ $(this).find(".gAjaxLink").gallery_ajax();
+ }
+ },
+ function() {
+ $(this).find("ul").slideUp("slow", function() { in_progress = 0; });
}
- },
- function() {
- $(this).find("ul").slideUp("slow", function() { in_progress = 0; });
- }
- );
+ );
+ }
};
$.gallery_auto_fit_window = function(imageWidth, imageHeight) {