Permalink
Browse files

MDL-38356 JavaScript: Correct check for currentform

  • Loading branch information...
1 parent db23afa commit 4969eb20ac9d659fe11619cb5e0630be45b66a04 @andrewnicols andrewnicols committed Mar 13, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/yui/formchangechecker/formchangechecker.js
@@ -18,16 +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 4969eb2

Please sign in to comment.