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/entity.js | 100 ++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 53 deletions(-) (limited to 'install/ui/entity.js') diff --git a/install/ui/entity.js b/install/ui/entity.js index 22d3eaff..026e66f7 100644 --- a/install/ui/entity.js +++ b/install/ui/entity.js @@ -37,8 +37,7 @@ IPA.facet = function (spec) { that.title = spec.title || that.label; that._entity_name = spec.entity_name; - that.dialogs = []; - that.dialogs_by_name = {}; + that.dialogs = $.ordered_map(); // facet group name that.facet_group = spec.facet_group; @@ -52,19 +51,19 @@ IPA.facet = function (spec) { }); that.get_dialog = function(name) { - return that.dialogs_by_name[name]; + return that.dialogs.get(name); }; that.dialog = function(dialog) { - that.dialogs.push(dialog); - that.dialogs_by_name[dialog.name] = dialog; + that.dialogs.put(dialog.name, dialog); return that; }; that.init = function() { - for (var i=0; i