diff --git a/install/ui/details.js b/install/ui/details.js index b84f7f468..320ed9a4c 100644 --- a/install/ui/details.js +++ b/install/ui/details.js @@ -163,6 +163,70 @@ IPA.section_builder = function(spec) { return that; }; +IPA.facet_policy = function() { + + var that = {}; + + that.init = function() { + }; + + that.post_create = function() { + }; + + that.post_load = function() { + }; + + return that; +}; + +IPA.facet_policies = function(spec) { + + var that = {}; + + that.container = spec.container; + that.policies = []; + + that.add_policy = function(policy) { + + policy.container = that.container; + that.policies.push(policy); + }; + + that.add_policies = function(policies) { + + if (!policies) return; + + for (var i=0; i + * Petr Vobornik * * Copyright (C) 2010 Red Hat * see file 'COPYING' for use and warranty information @@ -19,7 +20,7 @@ * along with this program. If not, see . */ -/* REQUIRES: widget.js */ +/* REQUIRES: widget.js, details.js */ IPA.dialog_button = function(spec) { @@ -68,6 +69,10 @@ IPA.dialog = function(spec) { that.widgets = IPA.widget_container(); that.fields = IPA.field_container({ container: that }); that.buttons = $.ordered_map(); + that.policies = IPA.facet_policies({ + container: that, + policies: spec.policies + }); that.create_button = function(spec) { var factory = spec.factory || IPA.dialog_button; @@ -122,6 +127,7 @@ IPA.dialog = function(spec) { widget.create(div); } + that.policies.post_create(); }; that.show_message = function(message) { @@ -233,6 +239,7 @@ IPA.dialog = function(spec) { that.create_builder(); that.builder.build(spec); that.fields.widgets_created(); + that.policies.init(); }; that.init();