diff options
author | Bharat Mediratta <bharat@menalto.com> | 2012-06-05 22:03:11 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2012-06-05 22:03:11 -0700 |
commit | b91d28474759c6183d06f93ab1ff7231d792449f (patch) | |
tree | 9f71f9e45cebe74c397d160ed0596896ad0e9e9f | |
parent | 8a01de1d3bda9060beb660caba4e703a538037bc (diff) |
Do a better job of displaying errors to the user on AJAX failures
in dialogs. Fixes #236.
-rw-r--r-- | lib/gallery.dialog.js | 13 |
1 files changed, 12 insertions, 1 deletions
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(); + } }); }, |