make enter switch to the first match in the list
This commit is contained in:
parent
212aa1ba69
commit
e0aef4c6e1
2 changed files with 4 additions and 2 deletions
|
@ -279,7 +279,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
|
|||
<input class="form-control monospace" type="text" id="bufferFilter" ng-model="search" ng-keydown="handleSearchBoxKey($event)" placeholder="Search">
|
||||
</form>
|
||||
</li>
|
||||
<li class="buffer" ng-class="{'active': content.active, 'indent': content.indent }" ng-repeat="(key, content) in buffers | toArray | filter:{fullName:search} | filter:hasUnread | orderBy:predicate">
|
||||
<li class="buffer" ng-class="{'active': content.active, 'indent': content.indent }" ng-repeat="(key, content) in (filteredBuffers = (buffers | toArray | filter:{fullName:search} | filter:hasUnread | orderBy:predicate))">
|
||||
<a href="#" ng-click="setActiveBuffer(content.id)" title="{{ content.fullName }}">
|
||||
<span class="badge pull-right" ng-hide="content.notification" ng-if="content.unread" ng-bind="content.unread"></span>
|
||||
<span class="badge pull-right danger" ng-show="content.notification" ng-bind="content.notification"></span>
|
||||
|
|
|
@ -856,7 +856,9 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
|||
} // Handle enter
|
||||
else if (code === 13) {
|
||||
$event.preventDefault();
|
||||
// TODO Switch to first matching buffer and reset query
|
||||
if ($scope.filteredBuffers.length > 0) {
|
||||
models.setActiveBuffer($scope.filteredBuffers[0].id);
|
||||
}
|
||||
$scope.search = '';
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue