mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Page tree node reflects any changes made to page (title, publication status) in its edit view, implemented on the level of cms-content dom element, rather than cms-edit-form level
This commit is contained in:
parent
587d195647
commit
f7030c56a5
@ -195,11 +195,7 @@
|
||||
|
||||
if(typeof(Behaviour) != 'undefined') Behaviour.apply(); // refreshes ComplexTableField
|
||||
|
||||
if(this.hasClass('cms-content')){
|
||||
this.find('form.cms-edit-form').trigger('reloadeditform', {form: form, origData: origData, xmlhttp: xmlhttp});
|
||||
}else{
|
||||
this.trigger('reloadeditform', {form: form, origData: origData, xmlhttp: xmlhttp});
|
||||
}
|
||||
this.trigger('reloadeditform', {form: form, origData: origData, xmlhttp: xmlhttp});
|
||||
}
|
||||
|
||||
// set status message based on response
|
||||
|
@ -154,7 +154,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
$('.cms-edit-form').live('reloadeditform', function(e, data) {
|
||||
this.parents('.cms-content:first').bind('reloadeditform', function(e, data) {
|
||||
self._onLoadNewPage(e, data);
|
||||
});
|
||||
},
|
||||
@ -192,7 +192,7 @@
|
||||
*/
|
||||
_onLoadNewPage: function(e, eventData) {
|
||||
var self = this;
|
||||
|
||||
|
||||
// finds a certain value in an array generated by jQuery.serializeArray()
|
||||
var findInSerializedArray = function(arr, name) {
|
||||
for(var i=0; i<arr.length; i++) {
|
||||
@ -201,15 +201,16 @@
|
||||
return false;
|
||||
};
|
||||
|
||||
var id = $(e.target.ID).val();
|
||||
var handledform = $(e.target).children('.cms-edit-form:first')[0];
|
||||
var id = $(handledform.ID).val();
|
||||
|
||||
// check if a form with a valid ID exists
|
||||
if(id) {
|
||||
var parentID = $(e.target.ParentID).val(),
|
||||
var parentID = $(handledform.ParentID).val(),
|
||||
parentNode = this.find('li[data-id='+parentID+']');
|
||||
node = this.find('li[data-id='+id+']'),
|
||||
title = $((e.target.TreeTitle) ? e.target.TreeTitle : e.target.Title).val(),
|
||||
className = $(e.target.ClassName).val();
|
||||
title = $((handledform.TreeTitle) ? handledform.TreeTitle : handledform.Title).val(),
|
||||
className = $(handledform.ClassName).val();
|
||||
|
||||
// set title (either from TreeTitle or from Title fields)
|
||||
// Treetitle has special HTML formatting to denote the status changes.
|
||||
|
Loading…
Reference in New Issue
Block a user