mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
keyboardNavigation: Fix keys 'c' and 'v' from webView
This fixes two small bugs: 1. The JavaScript-method is called "showDiff" instead of "showDiffs" sincecfbcfc1f38. That's why the 'v' button didn't work since then. 2. Commitf05d0188fcintroduced 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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user