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
This commit is contained in:
Sean Harvey 2009-04-06 02:12:08 +00:00 committed by Sam Minnee
parent 3b59294763
commit d781e268e8
1 changed files with 4 additions and 4 deletions

View File

@ -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 );