mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 04:23:46 +00:00
search: Replace deprecated jQuery event trigger shorthand.
$.fn.typeahead, on the other hand, returns the jQuery object back (not the Typeahead object, which also happens to have a select method), so this should be converted. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
7b35234c7b
commit
7ba3a26cd5
@@ -317,13 +317,12 @@ run_test("initiate_search", () => {
|
||||
$("#search_query").typeahead = (lookup) => {
|
||||
if (lookup === "lookup") {
|
||||
typeahead_forced_open = true;
|
||||
return {
|
||||
select: () => {
|
||||
is_searchbox_text_selected = true;
|
||||
},
|
||||
};
|
||||
}
|
||||
return $("#search_query");
|
||||
};
|
||||
$("#search_query").on("select", () => {
|
||||
is_searchbox_text_selected = true;
|
||||
});
|
||||
|
||||
search.initiate_search();
|
||||
assert(typeahead_forced_open);
|
||||
|
||||
@@ -263,13 +263,13 @@ run_test("initiate_search", () => {
|
||||
$("#search_query").typeahead = (lookup) => {
|
||||
if (lookup === "lookup") {
|
||||
typeahead_forced_open = true;
|
||||
return {
|
||||
select: () => {
|
||||
is_searchbox_text_selected = true;
|
||||
},
|
||||
};
|
||||
}
|
||||
return $("#search_query");
|
||||
};
|
||||
$("#search_query").on("select", () => {
|
||||
is_searchbox_text_selected = true;
|
||||
});
|
||||
|
||||
search.initiate_search();
|
||||
assert(typeahead_forced_open);
|
||||
assert(is_searchbox_text_selected);
|
||||
|
||||
@@ -209,7 +209,7 @@ exports.focus_search = function () {
|
||||
exports.initiate_search = function () {
|
||||
tab_bar.open_search_bar_and_close_narrow_description();
|
||||
$("#searchbox").css({"box-shadow": "inset 0px 0px 0px 2px hsl(204, 20%, 74%)"});
|
||||
$("#search_query").typeahead("lookup").select();
|
||||
$("#search_query").typeahead("lookup").trigger("select");
|
||||
if (page_params.search_pills_enabled) {
|
||||
$("#search_query").trigger("focus");
|
||||
ui_util.place_caret_at_end($("#search_query")[0]);
|
||||
|
||||
Reference in New Issue
Block a user