From 0346552bc635312bc3b9edee9f2f632106c9b397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 20 Dec 2015 11:19:04 +0100 Subject: [PATCH] Minor simplification. --- src/event/Key.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/event/Key.js b/src/event/Key.js index 85342afe..8af273a5 100644 --- a/src/event/Key.js +++ b/src/event/Key.js @@ -63,8 +63,7 @@ var Key = new function() { // based on whichever key is used for commands. command: { get: function() { - var browser = paper.browser; - return browser.mac ? this.meta : this.control; + return paper.browser.mac ? this.meta : this.control; } } }); @@ -104,8 +103,7 @@ var Key = new function() { // Detect modifiers and mark them as pressed / released if (key.length > 1 && (name = Base.camelize(key)) in modifiers) { modifiers[name] = down; - var browser = paper.browser; - if (name === 'meta' && browser && browser.mac) { + if (name === 'meta' && paper.browser.mac) { // Fix a strange behavior on Mac where no keyup events are // received for any keys pressed while the meta key is down. // Keep track of the normal keys being pressed and trigger keyup