Document magic number for escape key

This commit is contained in:
Daniel Gasienica
2018-02-09 17:40:14 -05:00
parent c790d07389
commit 7317110809

View File

@@ -4,6 +4,8 @@
(function () {
'use strict';
const ESCAPE_KEY_CODE = 27;
var FileView = Whisper.View.extend({
tagName: 'div',
className: 'fileView',
@@ -267,7 +269,7 @@
}
},
onkeyup: function(e) {
if (e.keyCode === 27) {
if (e.keyCode === ESCAPE_KEY_CODE) {
this.remove();
this.$document.off('keyup', this.listener);
}