Permalink
Browse files

API CHANGE Removed ajaxActionsAtTop() and prepareAjaxActions() javasc…

…ript methods, to be replaced with new concrete implementation

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92598 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent df79a94 commit 1b312ae81b0f5cba2e05ab49560ddebad162e23c @chillu chillu committed Nov 21, 2009
Showing with 0 additions and 55 deletions.
  1. +0 −46 javascript/LeftAndMain.js
  2. +0 −2 javascript/LeftAndMain_right.js
  3. +0 −6 javascript/ModelAdmin.js
  4. +0 −1 javascript/ReportAdmin_right.js
View
@@ -63,52 +63,6 @@ function unlockStatusMessage() {
}
/**
- * Move form actions to the top and make them ajax
- */
-function ajaxActionsAtTop(formName, actionHolderName, tabName) {
- var actions = document.getElementsBySelector('#' + formName + ' .Actions')[0];
- var holder;
-
- if((holder = $(actionHolderName)) && holder != actions) {
- holder.parentNode.removeChild(holder);
- }
-
- if(actions) {
- actions.id = actionHolderName;
- actions.className = 'ajaxActions';
-
- $(tabName).appendChild(actions);
- prepareAjaxActions(actions, formName, tabName);
- }
-}
-
-/**
- * Prepare the ajax actions so that the buttons actually do something
- */
-function prepareAjaxActions(actions, formName, tabName) {
- var i, button, list = actions.getElementsByTagName('input')
- for (i=0;button=list[i];i++) {
- button.ownerForm = $(formName);
-
- button.onclick = function(e) {
- if(!e) e = window.event;
- // tries to call a custom method of the format "action_<youraction>_right"
- if(window[this.name + '_' + tabName]) {
- window[this.name + '_' + tabName](e);
- } else {
- statusMessage('...');
- Ajax.SubmitForm(this.ownerForm, this.name, {
- onSuccess: Ajax.Evaluator,
- onFailure: ajaxErrorHandler
- });
- }
- return false;
- }
- // behaveAs(button, StatusTitle);
- }
-}
-
-/**
* Submit the given form and evaluate the Ajax response.
* Needs to be bound to an object with the following parameters to work:
* - form
@@ -22,7 +22,6 @@ CMSForm.prototype = {
* Processing called whenever a page is loaded in the right - including the initial one
*/
prepareForm : function() {
- ajaxActionsAtTop(this.id, 'form_actions_' + this.formName, this.formName);
},
/**
@@ -31,7 +30,6 @@ CMSForm.prototype = {
loadActionsFromString : function(actionHTML) {
var actionHolder = $('form_actions_' + this.formName);
actionHolder.innerHTML = actionHTML;
- prepareAjaxActions(actionHolder, this.id, this.formName);
},
/**
View
@@ -398,10 +398,4 @@ function fixHeight_left() {
//fitToParent('LeftPane');
fitToParent('Search_holder',12);
fitToParent('ResultTable_holder',12);
-}
-
-function prepareAjaxActions(actions, formName, tabName) {
- // @todo HACK Overwrites LeftAndMain.js version of this method to avoid double form actions
- // (by new jQuery and legacy prototype)
- return false;
}
@@ -10,7 +10,6 @@ Behaviour.register({
* Processing called whenever a page is loaded in the right - including the initial one
*/
prepareForm : function() {
- ajaxActionsAtTop('Form_EditForm', 'form_actions', 'right');
},
/**

0 comments on commit 1b312ae

Please sign in to comment.