simplify handled logic by inverting it

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2018-06-16 08:52:14 +01:00
parent ff33ef4b51
commit 423b8939e7
No known key found for this signature in database
GPG key ID: 3F879DA5AD802A5E

View file

@ -82,21 +82,20 @@ var LeftPanel = React.createClass({
_onKeyDown: function(ev) {
if (!this.focusedElement) return;
let handled = false;
let handled = true;
switch (ev.keyCode) {
case KeyCode.TAB:
this._onMoveFocus(ev.shiftKey);
handled = true;
break;
case KeyCode.UP:
this._onMoveFocus(true);
handled = true;
break;
case KeyCode.DOWN:
this._onMoveFocus(false);
handled = true;
break;
default:
handled = false;
}
if (handled) {