From 3bfd49a46543b5965298087fb6427e45760c4804 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Thu, 12 Jan 2012 11:11:47 -0600 Subject: Fixed problem removing automount keys and DNS records. Due to a recent change the deleting automount keys and DNS records no longer worked. The functions that are supposed to get the selected values has been fixed to use the correct names and element type. They also have been converted into methods of the search facets. Ticket #2256 --- install/ui/automount.js | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'install/ui/automount.js') diff --git a/install/ui/automount.js b/install/ui/automount.js index 3deb6612..13d7bfa2 100644 --- a/install/ui/automount.js +++ b/install/ui/automount.js @@ -71,12 +71,12 @@ IPA.automount.map_entity = function(spec) { that.builder.containing_entity('automountlocation'). facet_groups([ 'automountkey', 'settings' ]). nested_search_facet({ + factory: IPA.automount.key_search_facet, facet_group: 'automountkey', nested_entity: 'automountkey', pagination: false, label: IPA.metadata.objects.automountkey.label, name: 'keys', - get_values: IPA.get_option_values, columns: [ { factory: IPA.automount_key_column, @@ -301,19 +301,28 @@ IPA.automountmap_adder_dialog = function(spec) { return that; }; -IPA.get_option_values = function(){ +IPA.automount.key_search_facet = function(spec) { - var values = []; - $('input[name="select"]:checked', this.table.tbody).each(function() { - var value = {}; - $('span',$(this).parent().parent()).each(function(){ - var name = this.attributes['name'].value; + var that = IPA.nested_search_facet(spec); - value[name] = $(this).text(); + that.get_selected_values = function() { + + var values = []; + + $('input[name="description"]:checked', that.table.tbody).each(function() { + var value = {}; + $('div', $(this).parent().parent()).each(function() { + var div = $(this); + var name = div.attr('name'); + value[name] = div.text(); + }); + values.push(value); }); - values.push (value); - }); - return values; + + return values; + }; + + return that; }; IPA.register('automountlocation', IPA.automount.location_entity); -- cgit