Merge pull request #399 from glowing-bear/fix-keypress
Handle keypress events as well
This commit is contained in:
commit
06b1db8c9d
2 changed files with 3 additions and 3 deletions
|
@ -29,7 +29,7 @@
|
||||||
<script type="text/javascript" src="js/plugins.js"></script>
|
<script type="text/javascript" src="js/plugins.js"></script>
|
||||||
<script type="text/javascript" src="3rdparty/favico-0.3.4-mod.min.js"></script>
|
<script type="text/javascript" src="3rdparty/favico-0.3.4-mod.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body ng-controller="WeechatCtrl" ng-keydown="handleKeyPress($event)" ng-class="{'no-overflow': connected}" lang="en-US">
|
<body ng-controller="WeechatCtrl" ng-keydown="handleKeyPress($event)" ng-keypress="handleKeyPress($event)" ng-class="{'no-overflow': connected}" lang="en-US">
|
||||||
<div ng-hide="connected" class="container">
|
<div ng-hide="connected" class="container">
|
||||||
<h2>
|
<h2>
|
||||||
<img alt="logo" src="assets/img/glowing-bear.svg">
|
<img alt="logo" src="assets/img/glowing-bear.svg">
|
||||||
|
|
|
@ -1604,7 +1604,7 @@ weechat.directive('inputBar', function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Arrow up -> go up in history
|
// Arrow up -> go up in history
|
||||||
if (code === 38) {
|
if ($event.type === "keydown" && code === 38) {
|
||||||
$scope.command = models.getActiveBuffer().getHistoryUp($scope.command);
|
$scope.command = models.getActiveBuffer().getHistoryUp($scope.command);
|
||||||
// Set cursor to last position. Need 0ms timeout because browser sets cursor
|
// Set cursor to last position. Need 0ms timeout because browser sets cursor
|
||||||
// position to the beginning after this key handler returns.
|
// position to the beginning after this key handler returns.
|
||||||
|
@ -1617,7 +1617,7 @@ weechat.directive('inputBar', function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Arrow down -> go down in history
|
// Arrow down -> go down in history
|
||||||
if (code === 40) {
|
if ($event.type === "keydown" && code === 40) {
|
||||||
$scope.command = models.getActiveBuffer().getHistoryDown($scope.command);
|
$scope.command = models.getActiveBuffer().getHistoryDown($scope.command);
|
||||||
// We don't need to set the cursor to the rightmost position here, the browser does that for us
|
// We don't need to set the cursor to the rightmost position here, the browser does that for us
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue