Share highlighting behavior of userlist between mouse hover and keyboard selection
This effectively reproduces the behavior of the autocomplete menu.
This commit is contained in:
parent
649d60c119
commit
bfc8959bb9
@ -1204,7 +1204,7 @@ kbd {
|
||||
color: #50a656;
|
||||
}
|
||||
|
||||
#chat .user:hover {
|
||||
.chat .user:hover {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,19 @@ chat.on("input", ".users .search", function() {
|
||||
container.html(templates.user_filtered({matches: result})).show();
|
||||
});
|
||||
|
||||
chat.on("mouseenter", ".users .user", function() {
|
||||
// Reset any potential selection, this is required in cas there is already a
|
||||
// nick previously selected by keyboard
|
||||
$(".users .user").removeClass("active");
|
||||
|
||||
$(this).addClass("active");
|
||||
});
|
||||
|
||||
chat.on("mouseleave", ".users .user", function() {
|
||||
// Reset any potential selection
|
||||
$(".users .user").removeClass("active");
|
||||
});
|
||||
|
||||
exports.handleKeybinds = function(input) {
|
||||
Mousetrap(input.get(0)).bind(["up", "down"], (_e, key) => {
|
||||
const userlists = input.closest(".users");
|
||||
|
Loading…
Reference in New Issue
Block a user