From 120ad3a2cdb3e4221b8c5ee0d323168d39879a07 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 11 Jan 2009 00:18:29 +0000 Subject: Pull the dialog title from the first

we find, fall back to the first
--- lib/gallery.dialog.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/gallery.dialog.js') diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index a3da41e3..fef44b38 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -21,7 +21,6 @@ function handleDialogEvent(event) { */ function openDialog(element, on_success) { var sHref = $(element).attr("href"); - var sTitle = $(element).attr("title"); var eDialog = '
'; $("body").append(eDialog); @@ -49,7 +48,11 @@ function openDialog(element, on_success) { var parent = $("#gDialog").parent().parent(); parent.css("opacity", "0.0"); $("#gDialog").dialog("open"); - $("#ui-dialog-title-gDialog").html($("#gDialog fieldset legend:eq(0)").html()); + var title = $("#gDialog h1:eq(0)").html(); + if (!title) { + title = $("#gDialog fieldset legend:eq(0)").html(); + } + $("#ui-dialog-title-gDialog").html(title); if (parent.width() < 400) { parent.css("width", 400); } -- cgit v1.2.3