Skip to content

Commit

Permalink
MDL-33025 Ensure that hitting cancel clears the resource title editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Robert Nicols committed May 16, 2012
1 parent e0319e7 commit c9cbb5a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions course/yui/toolboxes/toolboxes.js
Expand Up @@ -572,6 +572,12 @@ YUI.add('moodle-course-toolboxes', function(Y) {
// Cancel the edit if we lose focus or the escape key is pressed // Cancel the edit if we lose focus or the escape key is pressed
thisevent = editor.on('blur', cancel_edittitle); thisevent = editor.on('blur', cancel_edittitle);
listenevents.push(thisevent); listenevents.push(thisevent);
thisevent = Y.one('document').on('keyup', function(e) {
if (e.keyCode == 27) {
cancel_edittitle(e);
}
});
listenevents.push(thisevent);


// Handle form submission // Handle form submission
thisevent = editform.on('submit', function(e) { thisevent = editform.on('submit', function(e) {
Expand Down

0 comments on commit c9cbb5a

Please sign in to comment.