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:
Sam Minnee 2008-08-19 05:18:11 +00:00
parent 27fd6937a5
commit e2eee05b83
3 changed files with 7 additions and 6 deletions

View File

@ -612,7 +612,6 @@ class ModelAdmin_RecordController extends Controller {
$validator = ($this->currentRecord->hasMethod('getCMSValidator')) ? $this->currentRecord->getCMSValidator() : null; $validator = ($this->currentRecord->hasMethod('getCMSValidator')) ? $this->currentRecord->getCMSValidator() : null;
$actions = new FieldSet( $actions = new FieldSet(
//new FormAction("goBack", "Back"),
new FormAction("doSave", "Save") new FormAction("doSave", "Save")
); );
@ -621,6 +620,8 @@ class ModelAdmin_RecordController extends Controller {
$deleteAction->addExtraClass('delete'); $deleteAction->addExtraClass('delete');
} }
$actions->insertFirst(new FormAction("goBack", "Back"));
$form = new Form($this, "EditForm", $fields, $actions, $validator); $form = new Form($this, "EditForm", $fields, $actions, $validator);
$form->loadDataFrom($this->currentRecord); $form->loadDataFrom($this->currentRecord);

View File

@ -252,11 +252,11 @@ function ajaxActionsAtTop(formName, actionHolderName, tabName) {
var actions = document.getElementsBySelector('#' + formName + ' .Actions')[0]; var actions = document.getElementsBySelector('#' + formName + ' .Actions')[0];
var holder; var holder;
if(actions) {
if((holder = $(actionHolderName)) && holder != actions) { if((holder = $(actionHolderName)) && holder != actions) {
holder.parentNode.removeChild(holder); holder.parentNode.removeChild(holder);
} }
if(actions) {
actions.id = actionHolderName; actions.id = actionHolderName;
actions.className = 'ajaxActions'; actions.className = 'ajaxActions';

View File

@ -142,7 +142,7 @@ jQuery(document).ready(function() {
data = formData(form); data = formData(form);
jQuery.get(form.attr('action'), data, function(result){ jQuery.get(form.attr('action'), data, function(result){
jQuery('#right #ModelAdminPanel').html(result); jQuery('#right #ModelAdminPanel').html(result);
jQuery('#form_actions_right').remove();
Behaviour.apply(); Behaviour.apply();
}); });