BUGFIX Check for form object before calling observe() on the element. The CheckBoxRange constructor allows for a null form, so a check for a form object is essential.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@70046 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-01-13 02:01:08 +00:00 committed by Sam Minnee
parent 6b5cab8dab
commit aeeb7bbc7b

View File

@ -102,8 +102,10 @@ CheckBoxRange.prototype = {
this.form = form;
this.field = field;
this.eventPossibleCheckHappened = this.possibleCheckHappened.bindAsEventListener(this);
Event.observe(form, "click", this.eventPossibleCheckHappened);
Event.observe(form, "keyup", this.eventPossibleCheckHappened);
if(form) {
Event.observe(form, "click", this.eventPossibleCheckHappened);
Event.observe(form, "keyup", this.eventPossibleCheckHappened);
}
},
possibleCheckHappened: function(event) {