Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mattia Rizzolo
nm.debian.org
Commits
4f809504
Unverified
Commit
4f809504
authored
Apr 20, 2020
by
Enrico Zini
Browse files
Don't trap keys when modifiers are set. Fixes:
#1
parent
d1233402
Changes
1
Hide whitespace changes
Inline
Side-by-side
process/static/js/mailbox-viewer.js
View file @
4f809504
...
...
@@ -3,6 +3,11 @@
const
epoch
=
"
1970-01-01T00:00:00+00:00
"
;
function
has_modifiers
(
evt
)
{
return
evt
.
altKey
||
evt
.
ctrlKey
||
evt
.
isComposing
||
evt
.
metaKey
||
evt
.
shiftKey
;
}
class
MessageTable
{
constructor
(
options
)
...
...
@@ -14,6 +19,10 @@ class MessageTable
this
.
table
=
$
(
this
.
el_table
).
find
(
"
table
"
);
this
.
el_tbody
.
addEventListener
(
"
keydown
"
,
evt
=>
{
// Skip all events with modifiers, since we don't use any, and this
// way we prevent eating browser shortcuts
if
(
has_modifiers
(
evt
))
return
;
const
code
=
evt
.
code
;
let
ignored
=
false
;
if
(
code
==
"
Escape
"
)
...
...
@@ -39,6 +48,9 @@ class MessageTable
});
this
.
el_tbody
.
addEventListener
(
"
wheel
"
,
evt
=>
{
// Skip all events with modifiers, since we don't use any so far
if
(
has_modifiers
(
evt
))
return
;
if
(
evt
.
deltaY
<
0
)
this
.
prev_message
();
else
...
...
@@ -46,6 +58,9 @@ class MessageTable
});
this
.
el_tbody
.
addEventListener
(
"
click
"
,
evt
=>
{
// Skip all events with modifiers, since we don't use any so far
if
(
has_modifiers
(
evt
))
return
;
// Find the row clicked
let
tr
=
evt
.
target
;
while
(
tr
&&
tr
.
tagName
!=
"
TR
"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment