summaryrefslogtreecommitdiff
path: root/lib/gallery.dialog.js
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2012-06-05 22:03:11 -0700
committerBharat Mediratta <bharat@menalto.com>2012-06-05 22:03:11 -0700
commitb91d28474759c6183d06f93ab1ff7231d792449f (patch)
tree9f71f9e45cebe74c397d160ed0596896ad0e9e9f /lib/gallery.dialog.js
parent8a01de1d3bda9060beb660caba4e703a538037bc (diff)
Do a better job of displaying errors to the user on AJAX failures
in dialogs. Fixes #236.
Diffstat (limited to 'lib/gallery.dialog.js')
-rw-r--r--lib/gallery.dialog.js13
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();
+ }
});
},