summaryrefslogtreecommitdiffstats
path: root/install/ui/entity.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-02-08 15:41:24 -0600
committerAdam Young <ayoung@redhat.com>2011-02-09 19:46:49 -0500
commit8d597dcbb03ca70a342f470e0229c9934f75cb16 (patch)
tree7311deb7976b677efba19d864e893d8406aebd0f /install/ui/entity.js
parent25abf07360ea6824f3584edd847e080e6fdca981 (diff)
downloadfreeipa-8d597dcbb03ca70a342f470e0229c9934f75cb16.tar.gz
freeipa-8d597dcbb03ca70a342f470e0229c9934f75cb16.tar.xz
freeipa-8d597dcbb03ca70a342f470e0229c9934f75cb16.zip
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.
Diffstat (limited to 'install/ui/entity.js')
-rw-r--r--install/ui/entity.js23
1 files changed, 21 insertions, 2 deletions
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<that.dialogs.length; i++){
+ var dialog = that.dialogs[i];
+ dialog.entity_name = that._entity_name;
+ dialog.init();
+ }
}
function create(container) {
@@ -75,6 +93,7 @@ IPA.facet = function (spec) {
return $('.action-panel', that.container);
};
+ // methods that should be invoked by subclasses
that.facet_init = that.init;
that.facet_create = that.create;
that.facet_setup = that.setup;