From 46137fdf898690836ae61e54b1cb2711492287f3 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Mon, 16 May 2011 22:23:20 -0500 Subject: jQuery ordered map. The ordered map is a jQuery extension for creating a collection which can be accessed both as an ordered list and as a map. This collection can be used to store various objects including entities, fields, columns, and dialogs. A test suite for this class has been added as well. Ticket #1232 --- install/ui/associate.js | 69 +++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 34 deletions(-) (limited to 'install/ui/associate.js') diff --git a/install/ui/associate.js b/install/ui/associate.js index 9d04b0c8..6f003418 100644 --- a/install/ui/associate.js +++ b/install/ui/associate.js @@ -309,16 +309,14 @@ IPA.association_table_widget = function (spec) { that.add_method = spec.add_method || 'add_member'; that.remove_method = spec.remove_method || 'remove_member'; - that.adder_columns = []; - that.adder_columns_by_name = {}; + that.adder_columns = $.ordered_map(); that.get_adder_column = function(name) { - return that.adder_columns_by_name[name]; + return that.adder_columns.get(name); }; that.add_adder_column = function(column) { - that.adder_columns.push(column); - that.adder_columns_by_name[column.name] = column; + that.adder_columns.put(column.name, column); }; that.create_adder_column = function(spec) { @@ -362,13 +360,15 @@ IPA.association_table_widget = function (spec) { }); } - for (var i=0; i