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/details.js | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) (limited to 'install/ui/details.js') diff --git a/install/ui/details.js b/install/ui/details.js index e8033b30..657d3bc3 100644 --- a/install/ui/details.js +++ b/install/ui/details.js @@ -40,8 +40,7 @@ IPA.details_section = function(spec) { that.template = spec.template; that._entity_name = spec.entity_name; - that.fields = []; - that.fields_by_name = {}; + that.fields = $.ordered_map(); that.__defineGetter__('entity_name', function() { return that._entity_name; @@ -50,19 +49,19 @@ IPA.details_section = function(spec) { that.__defineSetter__('entity_name', function(entity_name) { that._entity_name = entity_name; - for (var i=0; i', { 'name': field.name }).appendTo(container); @@ -122,8 +122,8 @@ IPA.details_section = function(spec) { if (that.template) return; - var fields = that.fields; - for (var i = 0; i < fields.length; ++i) { + var fields = that.fields.values; + for (var i=0; i