keyboardNavigation: Fix keys 'c' and 'v' from webView

This fixes two small bugs:
1. The JavaScript-method is called "showDiff" instead of "showDiffs"
since cfbcfc1f38. That's why the 'v' button didn't work since then.
2. Commit f05d0188fc 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 <heipei@hackvalue.de>
This commit is contained in:
Johannes Gilger
2009-06-10 16:39:36 +02:00
parent 13746a5a6b
commit ab870c66a8
+5 -9
View File
@@ -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();
}