From d781e268e80d6de57eb06b0cd415fea68a3ab047 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 6 Apr 2009 02:12:08 +0000 Subject: [PATCH] BUGFIX Fixed javascript error in CommentTableField.js where input elements were not being correctly picked up, due to the form HTML change git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@74098 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/CommentTableField.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/javascript/CommentTableField.js b/javascript/CommentTableField.js index 58f309a5..f7f838c8 100644 --- a/javascript/CommentTableField.js +++ b/javascript/CommentTableField.js @@ -78,7 +78,7 @@ CommentFilterButton.prototype = { initialize: function() { this.inputFields = new Array(); - var childNodes = this.parentNode.getElementsByTagName('input'); + var childNodes = this.parentNode.parentNode.getElementsByTagName('input'); for( var index = 0; index < childNodes.length; index++ ) { if( childNodes[index].tagName ) { @@ -108,7 +108,7 @@ CommentFilterButton.prototype = { var form = Event.findElement(e,"form"); var fieldName = $('CommentFieldName').value; var fieldID = form.id + '_' + fieldName; - + var updateURL = form.action + '/field/' + fieldName + '?ajax=1'; for( var index = 0; index < this.inputFields.length; index++ ) { if( this.inputFields[index].tagName ) { @@ -118,8 +118,8 @@ CommentFilterButton.prototype = { updateURL += ($('SecurityID') ? '&SecurityID=' + $('SecurityID').value : ''); new Ajax.Updater( fieldID, updateURL, { - onSuccess: function() { - Behaviour.apply(fieldID, true); + onComplete: function() { + Behaviour.apply($(fieldID), true); }, onFailure: function( response ) { errorMessage('Could not filter results: ' + response.responseText );