From 7317110809677dddbbef3fadbf912cdba1c010bf Mon Sep 17 00:00:00 2001 From: Daniel Gasienica Date: Fri, 9 Feb 2018 17:40:14 -0500 Subject: [PATCH] Document magic number for escape key --- js/views/attachment_view.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/views/attachment_view.js b/js/views/attachment_view.js index db25bad541..9c50470506 100644 --- a/js/views/attachment_view.js +++ b/js/views/attachment_view.js @@ -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); }