Permalink
Browse files

MDL-33729 Ensure that the cancel_popup event is correctly called when…

… using the [x] button on a chooser
  • Loading branch information...
andrewnicols committed Jun 14, 2012
1 parent 60d3ff9 commit 605f92ca1d74aae6c9ff790e631a49ef46271d23
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/yui/chooserdialogue/chooserdialogue.js
@@ -95,10 +95,14 @@ YUI.add('moodle-core-chooserdialogue', function(Y) {
}, this);
// Hook onto the cancel button to hide the form
- this.container.one('#addcancel').on('click', this.cancel_popup, this);
+ thisevent = this.container.one('#addcancel').on('click', this.cancel_popup, this);
+ this.listenevents.push(thisevent);
+ thisevent = bb.one('div.closebutton').on('click', this.cancel_popup, this);
+ this.listenevents.push(thisevent);
// Grab global keyup events and handle them
- Y.one('document').on('keyup', this.handle_key_press, this);
+ thisevent = Y.one('document').on('keyup', this.handle_key_press, this);
+ this.listenevents.push(thisevent);
// Add references to various elements we adjust
this.jumplink = this.container.one('#jump');

0 comments on commit 605f92c

Please sign in to comment.