Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG, EC] Rendering of localized classification store is slow in backend for many languages #395

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
kingjia90 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading