Fix regression: missing facet tab group labels

Currently there is only empty space between facet tabs and facet title.

It's a regression caused by recent refactoring.

https://fedorahosted.org/freeipa/ticket/3688
This commit is contained in:
Petr Vobornik 2013-06-03 15:14:20 +02:00
parent e87c21ade2
commit fae658f505
2 changed files with 15 additions and 10 deletions

View File

@ -240,17 +240,22 @@ exp.entity_builder =IPA.entity_builder = function(entity) {
];
that.facet_group = function(spec) {
spec.entity = entity;
if (spec instanceof Object) {
var factory = spec.$factory || IPA.facet_group;
facet_group = factory(spec);
} else {
facet_group = IPA.facet_group({ name: spec });
if (typeof spec === 'string') {
spec = { name: spec };
}
if (facet_group.label == undefined) {
facet_group.label = text.get('@i18n:facet_groups.'+facet_group.name);
}
var preop = function(spec) {
spec.entity = entity;
spec.label = spec.label || '@i18n:facet_groups.'+spec.name;
return spec;
};
var facet_group = builder.build('', spec, {}, {
$factory: IPA.facet_group,
$pre_ops: [preop]
});
entity.add_facet_group(facet_group);

View File

@ -909,7 +909,7 @@ exp.facet_header = IPA.facet_header = function(spec) {
if (!data) return;
var result = data.result.result;
if (!that.facet.disable_facet_tabs) {
var pkey = that.facet.pkey;
var pkey = that.facet.get_pkey();
var facet_groups = that.facet.entity.facet_groups.values;
for (var i=0; i<facet_groups.length; i++) {