Merge pull request #3494 from fantasticfears/esc-user-card

FIX: press ESC can close user card
This commit is contained in:
Régis Hanol 2015-05-21 10:58:26 +02:00
commit 664d2e11d7
1 changed files with 8 additions and 0 deletions

View File

@ -120,6 +120,14 @@ export default Discourse.View.extend(CleansUp, {
this.get('controller').close();
},
keyUp(e) {
if (e.keyCode === 27) { // ESC
const target = this.get('controller.cardTarget');
this.cleanUp();
target.focus();
}
},
_removeEvents: function() {
$('html').off(clickOutsideEventName);