mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX: moving the ajaxupdatesort JS response code from php to js to get rid of eval. Also disable the "loading" on the moved element when we are done, in case we are repositioning other than the selected item - otherwise the progress indicator is displayed indefinitely.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@100701 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
16f4e99af9
commit
3f6a4dedfd
@ -924,15 +924,6 @@ JS;
|
||||
DB::query("UPDATE \"$className\" SET \"Sort\" = $counter WHERE \"ID\" = '$id'");
|
||||
}
|
||||
}
|
||||
// Virtual pages require selected to be null if the page is the same.
|
||||
FormResponse::add(
|
||||
"if( $('sitetree').selected && $('sitetree').selected[0]){
|
||||
var idx = $('sitetree').selected[0].getIdx();
|
||||
if(idx){
|
||||
$('Form_EditForm').getPageFromServer(idx);
|
||||
}
|
||||
}\n" . $js
|
||||
);
|
||||
FormResponse::status_message(_t('LeftAndMain.SAVED'), 'good');
|
||||
} else {
|
||||
FormResponse::error(_t('LeftAndMain.REQUESTERROR',"Error in request"));
|
||||
|
@ -469,10 +469,15 @@ SiteTreeNode.prototype = {
|
||||
new Ajax.Request(SiteTreeHandlers.orderChanged_url, {
|
||||
method : 'post',
|
||||
postBody : parts.join('&') + '&CurrentlyOpenPageID=' + currentlyOpenPageID,
|
||||
/*onSuccess : function(response) {
|
||||
// statusMessage(response.responseText, 'good');
|
||||
},*/
|
||||
onSuccess: Ajax.Evaluator,
|
||||
onSuccess : function(response) {
|
||||
movedNode.removeNodeClass('loading');
|
||||
if( $('sitetree').selected && $('sitetree').selected[0]){
|
||||
var idx = $('sitetree').selected[0].getIdx();
|
||||
if(idx){
|
||||
$('Form_EditForm').getPageFromServer(idx);
|
||||
}
|
||||
}
|
||||
},
|
||||
onFailure : function(response) {
|
||||
errorMessage('error saving order', response);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user