MDL-26649 forms: ensure that both necessary variables are set before altering calendar image

This commit is contained in:
Mark Nelson 2013-04-10 11:18:17 +08:00 committed by Damyon Wiese
parent d2b11df8bd
commit 1711361042

View File

@ -86,9 +86,11 @@ YUI.add('moodle-form-dateselector', function(Y) {
node.on('click', this.toggle_calendar_image, this);
// Set the node to the enablecheckbox variable.
this.enablecheckbox = node;
}
// Ensure that the calendarimage and enablecheckbox values have been set.
if (this.calendarimage && this.enablecheckbox) {
// Set the calendar icon status depending on the value of the checkbox.
// QUICK HACK to keep JS working. MDL-26649. FIXME!
// this.toggle_calendar_image();
this.toggle_calendar_image();
}
}, this);
},