]> git.parisson.com Git - pdf.js.git/commitdiff
Fix lint issues
authorJulian Viereck <julian.viereck@gmail.com>
Thu, 19 Apr 2012 18:13:56 +0000 (20:13 +0200)
committerJulian Viereck <julian.viereck@gmail.com>
Fri, 20 Apr 2012 07:33:50 +0000 (09:33 +0200)
web/viewer.js

index 211938fbcf4d64d1c171b4396dfa1caf4e5c4f7e..228821e32fa2eacf012155d3961a39e9e8c35a0d 100644 (file)
@@ -1456,13 +1456,11 @@ window.addEventListener('pagechange', function pagechange(evt) {
 }, true);
 
 window.addEventListener('keydown', function keydown(evt) {
-  var cmd = 0;
-  if (evt.ctrlKey)  cmd |= 1;
-  if (evt.altKey)   cmd |= 2;
-  if (evt.shiftKey) cmd |= 4;
-  if (evt.metaKey)  cmd |= 8; 
-
   var handled = false;
+  var cmd = (evt.ctrlKey ? 1 : 0) |
+            (evt.altKey ? 2 : 0) |
+            (evt.shiftKey ? 4 : 0) |
+            (evt.metaKey ? 8 : 0);
 
   // First, handle the key bindings that are independent whether an input
   // control is selected or not.