Don't try to initialize contextual menu unless it has items

This commit is contained in:
Chad Kieffer
2009-09-21 21:56:27 -06:00
parent 33690a32bc
commit 68f3dab7f2
+16 -14
View File
@@ -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) {