summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2011-06-01 09:34:44 -0400
committerEndi Sukma Dewata <edewata@people02.fedoraproject.org>2011-06-01 14:56:58 +0000
commit6039fdd6b3002f65ecd0121b7ca6d31e49b9590e (patch)
treeffce7da61ff0d0128e1efea526676489611d4144 /install
parent554bda2a853c9d48edbde6746c428c58368c7a93 (diff)
downloadfreeipa-6039fdd6b3002f65ecd0121b7ca6d31e49b9590e.tar.gz
freeipa-6039fdd6b3002f65ecd0121b7ca6d31e49b9590e.tar.xz
freeipa-6039fdd6b3002f65ecd0121b7ca6d31e49b9590e.zip
redirect on error Code for redirecting on error has been moved to IPA.facet so it can be called from both details and assocaiton facets.
Diffstat (limited to 'install')
-rw-r--r--install/ui/associate.js8
-rw-r--r--install/ui/details.js17
-rw-r--r--install/ui/entity.js19
3 files changed, 21 insertions, 23 deletions
diff --git a/install/ui/associate.js b/install/ui/associate.js
index 73a19021a..cb741652f 100644
--- a/install/ui/associate.js
+++ b/install/ui/associate.js
@@ -1086,12 +1086,6 @@ IPA.association_facet = function (spec) {
that.refresh_table();
}
- function on_error(xhr, text_status, error_thrown) {
- var summary = $('span[name=summary]', that.table.tfoot).empty();
- summary.append('<p>Error: '+error_thrown.name+'</p>');
- summary.append('<p>'+error_thrown.message+'</p>');
- }
-
var pkey = IPA.get_entity(that.entity_name).get_primary_key();
IPA.command({
@@ -1099,7 +1093,7 @@ IPA.association_facet = function (spec) {
method: 'show',
args: pkey,
on_success: on_success,
- on_error: on_error
+ on_error: that.on_error
}).execute();
};
diff --git a/install/ui/details.js b/install/ui/details.js
index d9c948e97..80e7bd9e6 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -640,22 +640,7 @@ IPA.details_facet = function(spec) {
that.load(data.result.result);
};
- command.on_error = function(xhr, text_status, error_thrown) {
- 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.on_error = that.on_error;
command.execute();
};
diff --git a/install/ui/entity.js b/install/ui/entity.js
index 4b6ce1d0e..030bcb016 100644
--- a/install/ui/entity.js
+++ b/install/ui/entity.js
@@ -130,6 +130,25 @@ IPA.facet = function (spec) {
return $('.content', that.container);
};
+
+ that.on_error = function(xhr, text_status, error_thrown) {
+ 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>');
+ }
+ };
+
+
// methods that should be invoked by subclasses
that.facet_init = that.init;
that.facet_create_header = that.create_header;