From fbaf8b4e2fa8cde972ae6612e6d71a691a90b1b1 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 19 Jul 2018 06:46:40 -0400 Subject: [PATCH] code review for https://github.com/uBlockOrigin/uBlock-issues/issues/106 --- src/js/shortcuts.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/js/shortcuts.js b/src/js/shortcuts.js index 3437ade1f..5847b89e9 100644 --- a/src/js/shortcuts.js +++ b/src/js/shortcuts.js @@ -146,19 +146,20 @@ } return; } - /* status === 1 */ - let key = validStatus1Codes.get(ev.code); - if ( key === 'Shift' ) { - after.add('Shift'); - input.value = Array.from(after).join('+'); - return; - } - if ( key !== undefined ) { - after.add(key); - updateCapturedShortcut(); - status = 2; - input.blur(); - return; + if ( status === 1 ) { + let key = validStatus1Codes.get(ev.code); + if ( key === 'Shift' ) { + after.add('Shift'); + updateCapturedShortcut(); + return; + } + if ( key !== undefined ) { + after.add(key); + updateCapturedShortcut(); + status = 2; + input.blur(); + return; + } } };