From 60908fd14356f3a01d957d2a29c10a07460f0870 Mon Sep 17 00:00:00 2001 From: Johannes Gilger Date: Wed, 10 Jun 2009 17:13:35 +0200 Subject: [PATCH] keyboardNavigation: Fix keys 'c' and 'v' from webView This fixes two small bugs: 1. The JavaScript-method is called "showDiff" instead of "showDiffs" since cfbcfc1f38ac. That's why the 'v' button didn't work since then. 2. Commit f05d0188fce3b5e introduced an error when trying to access "event" for key-presses from Cocoa, which resulted in an error and therefore made the following if-statements unreachable. Signed-off-by: Johannes Gilger --- html/lib/keyboardNavigation.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/html/lib/keyboardNavigation.js b/html/lib/keyboardNavigation.js index 02b9754..28a57ac 100644 --- a/html/lib/keyboardNavigation.js +++ b/html/lib/keyboardNavigation.js @@ -17,10 +17,10 @@ var handleKeys = function(event) { return changeFile(true); else if (event.keyCode == 38 && event.ctrlKey == true) // ctrl-up_arrow return changeFile(false); - else if (event.keyCode == 86) {// 'v' - showDiffs(); - return false; - } + else if (event.keyCode == 86) // 'v' + showDiff(); + else if (event.keyCode == 67) // 'c' + Controller.copySource(); return true; } @@ -29,12 +29,8 @@ var handleKeyFromCocoa = function(key) { changeHunk(true); else if (key == 'k') changeHunk(false); - else if (event.keyCode == 40 && event.ctrlKey == true) // ctrl-down_arrow - changeFile(true); - else if (event.keyCode == 38 && event.ctrlKey == true) // ctrl-up_arrow - changeFile(false); else if (key == 'v') - showDiffs(); + showDiff(); else if (key == 'c') Controller.copySource(); }