From b91d28474759c6183d06f93ab1ff7231d792449f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 5 Jun 2012 22:03:11 -0700 Subject: Do a better job of displaying errors to the user on AJAX failures in dialogs. Fixes #236. --- lib/gallery.dialog.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index 087b00ab..3115532b 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -71,6 +71,12 @@ $("#g-dialog").dialog("option", "self", self); }, + error: function(xhr, textStatus, errorThrown) { + $("#g-dialog").html(xhr.responseText); + self._set_title(); + self._layout(); + }, + _layout: function() { var dialogWidth; var dialogHeight = $("#g-dialog").height(); @@ -178,7 +184,12 @@ window.location.reload(); } } - } + }, + error: function(xhr, textStatus, errorThrown) { + $("#g-dialog").html(xhr.responseText); + self._set_title(); + self._layout(); + } }); }, -- cgit v1.2.3