BUGFIX: getting rid of problem with disappearing buttons on the initial page load (not ajax). The initialization was called twice on the CMSForm, and on the second call the ajaxActionsAtTop was removing the buttons - now the buttons are removed only when there is something to be added.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@96551 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Mateusz Uzdowski 2010-01-10 22:27:40 +00:00 committed by Sam Minnee
parent 305cfe9c36
commit ea20f1101f

View File

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