list_cursor: Convert list_cursor to an ES6 class ListCursor.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-07-22 16:48:16 -07:00
committed by Tim Abbott
parent 9d90ae0e69
commit 2e94914be4
7 changed files with 82 additions and 81 deletions

View File

@@ -288,7 +288,7 @@ function keydown_enter_key() {
}
exports.set_cursor_and_filter = function () {
exports.user_cursor = list_cursor({
exports.user_cursor = new ListCursor({
list: buddy_list,
highlight_class: "highlighted_user",
});
@@ -296,12 +296,12 @@ exports.set_cursor_and_filter = function () {
exports.user_filter = new UserSearch({
update_list: update_users_for_search,
reset_items: exports.reset_users,
on_focus: exports.user_cursor.reset,
on_focus: () => exports.user_cursor.reset(),
});
const $input = exports.user_filter.input_field();
$input.on("blur", exports.user_cursor.clear);
$input.on("blur", () => exports.user_cursor.clear());
keydown_util.handle({
elem: $input,