make enter switch to the first match in the list

This commit is contained in:
Felix Eckhofer 2014-02-21 09:37:55 +01:00
commit e0aef4c6e1
2 changed files with 4 additions and 2 deletions

View file

@ -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 = '';
}
};