Skip to content

Commit

Permalink
[BUG, EC] Rendering of localized classification store is slow in back…
Browse files Browse the repository at this point in the history
…end for many languages (#395)

* Fix: Lazy load the languages of CS

* Fix: Lazy load the languages of CS

* Fix: Lazy load the languages of CS
  • Loading branch information
robertSt7 authored Jan 16, 2024
1 parent ee9fe48 commit 42b499c
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions public/js/pimcore/object/tags/classificationstore.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,6 @@ pimcore.object.tags.classificationstore = Class.create(pimcore.object.tags.abstr
this.languageElements[this.currentLanguage] = [];
this.groupElements[this.currentLanguage] = {};

var childItems = [];


for (var groupId in this.fieldConfig.activeGroupDefinitions) {
var groupedChildItems = [];

if (this.fieldConfig.activeGroupDefinitions.hasOwnProperty(groupId)) {
var group = this.fieldConfig.activeGroupDefinitions[groupId];

var fieldset = this.createGroupFieldset(this.currentLanguage, group, groupedChildItems);

childItems.push(fieldset);

}
}
var title = this.frontendLanguages[i];
if (title != "default") {
var title = t(pimcore.available_languages[title]);
Expand All @@ -184,9 +169,32 @@ pimcore.object.tags.classificationstore = Class.create(pimcore.object.tags.abstr
hideMode: "offsets",
iconCls: icon,
title: title,
items: childItems
});
listeners: {
activate: function(frontendLanguage, tab) {
if (tab.items.length !== 0) {
return;
}

this.currentLanguage = frontendLanguage;

const childItems = [];
for (const groupId in this.fieldConfig.activeGroupDefinitions) {
const groupedChildItems = [];

if (this.fieldConfig.activeGroupDefinitions.hasOwnProperty(groupId)) {
const group = this.fieldConfig.activeGroupDefinitions[groupId];

const fieldset = this.createGroupFieldset(this.currentLanguage, group, groupedChildItems);

childItems.push(fieldset);
}
}

tab.add(childItems);
this.component.updateLayout();
}.bind(this, this.frontendLanguages[i])
}
})
this.languagePanels[this.currentLanguage] = item;

if (this.fieldConfig.labelWidth) {
Expand All @@ -207,11 +215,9 @@ pimcore.object.tags.classificationstore = Class.create(pimcore.object.tags.abstr

}

this.currentLanguage = this.frontendLanguages[0];

this.component = new Ext.Panel(wrapperConfig);

this.component.updateLayout();
return this.component;
},

Expand Down

0 comments on commit 42b499c

Please sign in to comment.