Skip to content

Commit

Permalink
MDL-28987 Forms Library: Removed onBlur validation. Now the validatio…
Browse files Browse the repository at this point in the history
…n will occur on form submit only
  • Loading branch information
Rajesh Taneja committed Sep 5, 2011
1 parent ab978b3 commit a82e9ad
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions lib/editor/tinymce/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,11 @@ M.editor_tinymce.onblur_event = function(ed) {
//have loaded contents and submitting form should not throw error.
ed.save();

//Attach blur event for tinymce to call onchange validation function of textarea.
//Attach blur event for tinymce to save contents to textarea
var doc = s.content_editable ? ed.getBody() : (tinymce.isGecko ? ed.getDoc() : ed.getWin());
tinymce.dom.Event.add(doc, 'blur', function() {
//save contents to textarea before calling validation script.
ed.save();
var element = document.getElementById(ed.id);
element.onchange(element);
});

//Add an extra event to make sure after window is blurred because of user clicking
//out of tinymce or any popup occured, then error should be cleaned on focusing back.
tinymce.dom.Event.add(doc, 'focus', function() {
var element = document.getElementById(ed.id);
qf_errorHandler(element, '');
});
};
};

0 comments on commit a82e9ad

Please sign in to comment.