webui: add parent link to widgets in ContainerMixin

Standard facets sets `facet` attribute to widgets. This one adds
similar, more generic `parent` attribute which should be used for going through
the hierarchy up to top.

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
This commit is contained in:
Petr Vobornik 2014-05-16 18:25:04 +02:00
parent 86898065b5
commit 6f5e80b0ce
2 changed files with 3 additions and 0 deletions

View File

@ -5747,6 +5747,7 @@ exp.activity_widget = IPA.activity_widget = function(spec) {
exp.pre_op = function(spec, context) {
if (context.facet) spec.facet = context.facet;
if (context.parent) spec.parent = context.parent;
if (context.entity) spec.entity = context.entity;
return spec;
};

View File

@ -147,6 +147,8 @@ define(['dojo/_base/declare',
this.widgets = ordered_map();
var builder_spec = spec.widget_builder || widget_mod.widget_builder;
this.widget_builder = builder.build(null, builder_spec);
this.widget_builder.widget_options = this.widget_builder.widget_options || {};
this.widget_builder.widget_options.parent = this;
}
});