diff options
author | Adam Young <ayoung@redhat.com> | 2011-06-22 13:21:40 -0400 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-06-23 20:24:14 -0400 |
commit | cbffe1d65df222acf6eb26cdaa121932a01f9ba7 (patch) | |
tree | e73a874433ce34fbef98f5ddf7a8109ad223188c /install/ui/add.js | |
parent | 8810758c11df8afb5fb7ddf97a71c55a431edfd2 (diff) | |
download | freeipa-cbffe1d65df222acf6eb26cdaa121932a01f9ba7.tar.gz freeipa-cbffe1d65df222acf6eb26cdaa121932a01f9ba7.tar.xz freeipa-cbffe1d65df222acf6eb26cdaa121932a01f9ba7.zip |
automountkey details
Adds hooks for navigation to the show page due to the unusual way that keys are accessed.
https://fedorahosted.org/freeipa/ticket/1257
Diffstat (limited to 'install/ui/add.js')
-rw-r--r-- | install/ui/add.js | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/install/ui/add.js b/install/ui/add.js index cde6d335b..67e14eddc 100644 --- a/install/ui/add.js +++ b/install/ui/add.js @@ -33,8 +33,19 @@ IPA.add_dialog = function (spec) { that.title = spec.title; that._entity_name = spec.entity_name; that.method = spec.method || 'add'; - that.init = function() { + function show_edit_page(entity_name,result){ + var pkey_name = IPA.metadata.objects[entity_name].primary_key; + var pkey = result[pkey_name]; + if (pkey instanceof Array) { + pkey = pkey[0]; + } + IPA.nav.show_page(that.entity_name, 'default', pkey); + } + + that.show_edit_page = spec.show_edit_page || show_edit_page; + + that.init = function() { that.add_button(IPA.messages.buttons.add, function() { var record = {}; that.save(record); @@ -74,16 +85,9 @@ IPA.add_dialog = function (spec) { function(data, text_status, xhr) { that.close(); - var pkey_name = IPA.metadata.objects[that.entity_name].primary_key; - + var entity_name = that.entity_name; var result = data.result.result; - var pkey = result[pkey_name]; - - if (pkey instanceof Array) { - pkey = pkey[0]; - } - - IPA.nav.show_page(that.entity_name, 'default', pkey); + that.show_edit_page(entity_name,result); } ); }); |