From 8d597dcbb03ca70a342f470e0229c9934f75cb16 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Tue, 8 Feb 2011 15:41:24 -0600 Subject: Moved add dialog into search facet. Previously the add dialog is added into entity. The dialog is only used by the search facet, so it's now moved into the search facet. --- install/ui/entity.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'install/ui/entity.js') diff --git a/install/ui/entity.js b/install/ui/entity.js index 4a8971d35..fdc45d827 100644 --- a/install/ui/entity.js +++ b/install/ui/entity.js @@ -40,17 +40,35 @@ IPA.facet = function (spec) { that.setup = spec.setup || setup; that.load = spec.load || load; - that.__defineGetter__("entity_name", function(){ + that.dialogs = []; + that.dialogs_by_name = {}; + + that.__defineGetter__('entity_name', function() { return that._entity_name; }); - that.__defineSetter__("entity_name", function(entity_name){ + that.__defineSetter__('entity_name', function(entity_name) { that._entity_name = entity_name; }); that.create_action_panel = IPA.facet_create_action_panel; + that.get_dialog = function(name) { + return that.dialogs_by_name[name]; + }; + + that.dialog = function(dialog) { + that.dialogs.push(dialog); + that.dialogs_by_name[dialog.name] = dialog; + return that; + }; + function init() { + for (var i=0; i