summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChad Kieffer <ckieffer@bernie.local>2009-09-21 21:56:27 -0600
committerChad Kieffer <ckieffer@bernie.local>2009-09-21 21:56:27 -0600
commit68f3dab7f202fbd9b690f4db27cc4f4038e58d2f (patch)
tree2499025abfda45a57c87b47e6600b01cdef4922c /lib
parent33690a32bcf132e5ab470ff77ba23c073ac26271 (diff)
Don't try to initialize contextual menu unless it has items
Diffstat (limited to 'lib')
-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) {