mirror of
https://github.com/zulip/zulip.git
synced 2025-10-25 00:53:56 +00:00
js: Replace deprecated jQuery event trigger shorthand.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
4e42137bd9
commit
a9ca5f603b
@@ -280,7 +280,7 @@ exports.create = function (opts) {
|
||||
// below that handles events on the ".pill" class.
|
||||
if (char === KEY.LEFT_ARROW) {
|
||||
if (window.getSelection().anchorOffset === 0) {
|
||||
store.$parent.find(".pill").last().focus();
|
||||
store.$parent.find(".pill").last().trigger("focus");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,14 +306,14 @@ exports.create = function (opts) {
|
||||
const $pill = store.$parent.find(".pill:focus");
|
||||
|
||||
if (char === KEY.LEFT_ARROW) {
|
||||
$pill.prev().focus();
|
||||
$pill.prev().trigger("focus");
|
||||
} else if (char === KEY.RIGHT_ARROW) {
|
||||
$pill.next().focus();
|
||||
$pill.next().trigger("focus");
|
||||
} else if (char === KEY.BACKSPACE) {
|
||||
const $next = $pill.next();
|
||||
const id = $pill.data("id");
|
||||
funcs.removePill(id);
|
||||
$next.focus();
|
||||
$next.trigger("focus");
|
||||
// the "backspace" key in FireFox will go back a page if you do
|
||||
// not prevent it.
|
||||
e.preventDefault();
|
||||
@@ -351,12 +351,12 @@ exports.create = function (opts) {
|
||||
const id = $pill.data("id");
|
||||
|
||||
funcs.removePill(id);
|
||||
$next.focus();
|
||||
$next.trigger("focus");
|
||||
});
|
||||
|
||||
store.$parent.on("click", function (e) {
|
||||
if ($(e.target).is(".pill-container")) {
|
||||
$(this).find(".input").focus();
|
||||
$(this).find(".input").trigger("focus");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user