redirect on show error.

This commit is contained in:
Adam Young authored and Endi Sukma Dewata committed 2011-05-31 22:28:31 +00:00
1 parent 007f6dd4c2
commit 554bda2a85
1 file changed
+14 -3
+14 -3
View File
@@ -641,9 +641,20 @@ IPA.details_facet = function(spec) {
};
command.on_error = function(xhr, text_status, error_thrown) {
var details = $('.details', that.container).empty();
details.append('<p>Error: '+error_thrown.name+'</p>');
details.append('<p>'+error_thrown.message+'</p>');
if (that.entity.redirect_facet) {
var current_entity = that.entity;
while (current_entity.containing_entity){
current_entity = current_entity.containing_entity;
}
IPA.nav.show_page(
current_entity.name,
that.entity.redirect_facet);
return;
}else{
var details = $('.details', that.container).empty();
details.append('<p>Error: '+error_thrown.name+'</p>');
details.append('<p>'+error_thrown.message+'</p>');
}
};
command.execute();