Skip to content

Commit

Permalink
Fix ability to rename content field (#16444)
Browse files Browse the repository at this point in the history
Co-authored-by: Jim Graham <info@sparkmediagroup.com>
  • Loading branch information
2 people authored and opengeek committed Oct 2, 2023
1 parent 6372f0d commit a89bc1f
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions manager/assets/modext/core/modx.js
Original file line number Diff line number Diff line change
Expand Up @@ -625,23 +625,13 @@ Ext.extend(MODx,Ext.Component,{
* @return {void}
*/
,renameLabel: function(containerId, fieldId, newLabel) {
let container;
if (containerId == 'modx-panel-resource' && fieldId.indexOf('modx-resource-content') != -1) {
container = Ext.getCmp('modx-resource-content');
if (!container) {
return;
}
if (container.setTitle) {
container.setTitle(newLabel);
return;
}
if (container.setLabel) {
container.setLabel(fieldId, newLabel);
return;
if (fieldId.indexOf('modx-resource-content') !== -1) {
const contentCmp = Ext.getCmp('ta');
if (contentCmp) {
contentCmp.label.update(newLabel);
}
container.label.update(newLabel);
} else {
container = Ext.getCmp(containerId);
const container = Ext.getCmp(containerId);
if (container) {
container.setLabel(fieldId, newLabel);
}
Expand Down

0 comments on commit a89bc1f

Please sign in to comment.