FIX: press ESC can close user card

This commit is contained in:
Erick Guan 2015-05-21 10:40:28 +08:00
parent 2b208db071
commit 7d8cf2eb3d

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);