mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX: Update the tree w/ javascript when MenuTitle is updated, not Title (Trac #7496)
This commit is contained in:
parent
4986355e3f
commit
447ef16294
@ -41,7 +41,7 @@
|
||||
} else {
|
||||
$('.update', self.parent()).show();
|
||||
}
|
||||
self.updatePanelLabels(title);
|
||||
self.updateBreadcrumbLabel(title);
|
||||
});
|
||||
}
|
||||
|
||||
@ -78,18 +78,16 @@
|
||||
},
|
||||
|
||||
/**
|
||||
* Function: updatePanelLabels
|
||||
* Function: updateBreadcrumbLabel
|
||||
*
|
||||
* Update the breadcrumb and tree
|
||||
* Update the breadcrumb
|
||||
* (String) title
|
||||
*/
|
||||
updatePanelLabels: function(title) {
|
||||
updateBreadcrumbLabel: function(title) {
|
||||
var pageID = $('.cms-edit-form input[name=ID]').val();
|
||||
var panelCrumb = $('span.cms-panel-link.crumb');
|
||||
var treeItem = $('.item', $('.cms-tree').find("[data-id='" + pageID + "']"));
|
||||
if (title && title != "") {
|
||||
panelCrumb.text(title);
|
||||
treeItem.text(title);
|
||||
}
|
||||
},
|
||||
|
||||
@ -118,6 +116,31 @@
|
||||
updateURLFromTitle.hide();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* MenuTitle
|
||||
*/
|
||||
$('.cms-edit-form input[name=MenuTitle]').entwine({
|
||||
onchange: function() {
|
||||
var menuTitle = this.val();
|
||||
this.updateTreeLabel(menuTitle);
|
||||
},
|
||||
|
||||
/**
|
||||
* Function: updatePanelLabels
|
||||
*
|
||||
* Update the tree
|
||||
* (String) title
|
||||
*/
|
||||
updateTreeLabel: function(title) {
|
||||
var pageID = $('.cms-edit-form input[name=ID]').val();
|
||||
var treeItem = $('.item', $('.cms-tree').find("[data-id='" + pageID + "']"));
|
||||
if (title && title != "") {
|
||||
treeItem.text(title);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Class: .cms-edit-form .parentTypeSelector
|
||||
|
Loading…
Reference in New Issue
Block a user