mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 09:05:53 +00:00
Added back button to ModelAdmin detail views
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@61056 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
27fd6937a5
commit
e2eee05b83
@ -612,7 +612,6 @@ class ModelAdmin_RecordController extends Controller {
|
||||
$validator = ($this->currentRecord->hasMethod('getCMSValidator')) ? $this->currentRecord->getCMSValidator() : null;
|
||||
|
||||
$actions = new FieldSet(
|
||||
//new FormAction("goBack", "Back"),
|
||||
new FormAction("doSave", "Save")
|
||||
);
|
||||
|
||||
@ -620,6 +619,8 @@ class ModelAdmin_RecordController extends Controller {
|
||||
$actions->insertFirst($deleteAction = new FormAction('doDelete', 'Delete'));
|
||||
$deleteAction->addExtraClass('delete');
|
||||
}
|
||||
|
||||
$actions->insertFirst(new FormAction("goBack", "Back"));
|
||||
|
||||
$form = new Form($this, "EditForm", $fields, $actions, $validator);
|
||||
$form->loadDataFrom($this->currentRecord);
|
||||
|
@ -252,11 +252,11 @@ function ajaxActionsAtTop(formName, actionHolderName, tabName) {
|
||||
var actions = document.getElementsBySelector('#' + formName + ' .Actions')[0];
|
||||
var holder;
|
||||
|
||||
if(actions) {
|
||||
if((holder = $(actionHolderName)) && holder != actions) {
|
||||
holder.parentNode.removeChild(holder);
|
||||
}
|
||||
if((holder = $(actionHolderName)) && holder != actions) {
|
||||
holder.parentNode.removeChild(holder);
|
||||
}
|
||||
|
||||
if(actions) {
|
||||
actions.id = actionHolderName;
|
||||
actions.className = 'ajaxActions';
|
||||
|
||||
|
@ -142,7 +142,7 @@ jQuery(document).ready(function() {
|
||||
data = formData(form);
|
||||
jQuery.get(form.attr('action'), data, function(result){
|
||||
jQuery('#right #ModelAdminPanel').html(result);
|
||||
|
||||
jQuery('#form_actions_right').remove();
|
||||
Behaviour.apply();
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user