Permalink
Browse files

Merge branch 'MDL-38356-m24' of git://github.com/andrewnicols/moodle …

…into MOODLE_24_STABLE
  • Loading branch information...
nebgor committed Mar 14, 2013
2 parents 8513176 + 4969eb2 commit ecbf8aee6eaec93c777343863357948dad797841
Showing with 8 additions and 3 deletions.
  1. +8 −3 lib/yui/formchangechecker/formchangechecker.js
@@ -18,11 +18,16 @@ YUI.add('moodle-core-formchangechecker',
/**
* Initialize the module
*/
- initializer : function(config) {
- var formid = 'form#' + this.get('formid');
+ initializer : function() {
+ var formid = 'form#' + this.get('formid'),
+ currentform = Y.one(formid);
+
+ if (!currentform) {
+ // If the form was not found, then we can't check for changes.
+ return;
+ }
// Add change events to the form elements
- var currentform = Y.one(formid);
currentform.delegate('change', M.core_formchangechecker.set_form_changed, 'input', this);
currentform.delegate('change', M.core_formchangechecker.set_form_changed, 'textarea', this);
currentform.delegate('change', M.core_formchangechecker.set_form_changed, 'select', this);

0 comments on commit ecbf8ae

Please sign in to comment.