From 99fc3d597af0cf07db1379b87ef2f635100dc89f Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Tue, 5 Feb 2013 13:33:58 +0100 Subject: Remove IPA.current_entity usage https://fedorahosted.org/freeipa/ticket/3236 --- install/ui/src/freeipa/add.js | 6 ++---- install/ui/src/freeipa/automember.js | 16 ++++++---------- install/ui/src/freeipa/details.js | 3 ++- install/ui/src/freeipa/dialog.js | 5 +++++ install/ui/src/freeipa/dns.js | 13 +++---------- install/ui/src/freeipa/field.js | 1 + install/ui/src/freeipa/search.js | 1 + install/ui/src/freeipa/user.js | 4 ++-- install/ui/src/freeipa/widget.js | 8 ++------ 9 files changed, 24 insertions(+), 33 deletions(-) (limited to 'install/ui') diff --git a/install/ui/src/freeipa/add.js b/install/ui/src/freeipa/add.js index 388b4e497..a2b60435e 100644 --- a/install/ui/src/freeipa/add.js +++ b/install/ui/src/freeipa/add.js @@ -59,8 +59,7 @@ IPA.entity_adder_dialog = function(spec) { function(data, text_status, xhr) { that.added.notify(); that.show_message(that.get_success_message(data)); - var facet = IPA.current_entity.get_facet(); - facet.refresh(); + that.facet.refresh(); that.reset(); that.focus_first_element(); }, @@ -101,8 +100,7 @@ IPA.entity_adder_dialog = function(spec) { that.add( function(data, text_status, xhr) { that.added.notify(); - var facet = IPA.current_entity.get_facet(); - facet.refresh(); + that.facet.refresh(); that.close(); that.notify_success(data); }, diff --git a/install/ui/src/freeipa/automember.js b/install/ui/src/freeipa/automember.js index 0e05b8c59..0f188bd19 100644 --- a/install/ui/src/freeipa/automember.js +++ b/install/ui/src/freeipa/automember.js @@ -331,8 +331,8 @@ IPA.automember.rule_adder_dialog = function(spec) { if (pkey instanceof Array) { pkey = pkey[0]; } - var facet = IPA.current_entity.get_facet(); - var facetname = facet.group_type === 'group' ? 'usergrouprule' : + + var facetname = that.facet.group_type === 'group' ? 'usergrouprule' : 'hostgrouprule'; navigation.show_entity(that.entity.name, facetname, [pkey]); @@ -341,19 +341,17 @@ IPA.automember.rule_adder_dialog = function(spec) { that.reset = function() { var field = that.fields.get_field('cn'); - var facet = IPA.current_entity.get_facet(); - field.widget.other_entity = IPA.get_entity(facet.group_type); + field.widget.other_entity = IPA.get_entity(that.facet.group_type); that.dialog_reset(); }; that.create_add_command = function(record) { - var facet = IPA.current_entity.get_facet(); var command = that.entity_adder_dialog_create_add_command(record); - command.name = that.entity.name+facet.group_type+'_show'; - command.set_option('type', facet.group_type); + command.name = that.entity.name+that.facet.group_type+'_show'; + command.set_option('type', that.facet.group_type); return command; }; @@ -370,13 +368,11 @@ IPA.automember.rule_deleter_dialog = function(spec) { that.create_command = function() { - var facet = IPA.current_entity.get_facet(); - var batch = that.search_deleter_dialog_create_command(); for (var i=0; i