fix bug with keydownlistener

This commit is contained in:
Matteo Manzinello 2019-05-26 14:21:53 +02:00
parent f5d7bef15c
commit ca785d6be8
3 changed files with 18 additions and 19 deletions

7
dist/mailgo.js vendored
View File

@ -232,9 +232,9 @@ var mailgoRender = function mailgoRender(mailgo) {
showMailgo(); // listener keyDown
mailgo.addEventListener("keydown", function () {
document.addEventListener("keydown", function () {
return mailgoKeydown(mail, cc, bcc, subject, bodyMail, url, mailtoHref, encEmail, copyButton);
}, false);
});
}; // actions
@ -305,7 +305,8 @@ var mailgoCheckRender = function mailgoCheckRender(event) {
var mailgoKeydown = function mailgoKeydown(mail, cc, bcc, subject, bodyMail, url, mailtoHref, encEmail, copyButton) {
// if mailgo is not showing do nothing
console.log("keydown"); // if mailgo is not showing do nothing
if (!mailgoIsShowing()) return;
switch (event.keyCode) {

2
dist/mailgo.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -289,9 +289,7 @@ const mailgoRender = mailgo => {
showMailgo();
// listener keyDown
mailgo.addEventListener(
"keydown",
() =>
document.addEventListener("keydown", () =>
mailgoKeydown(
mail,
cc,
@ -302,8 +300,7 @@ const mailgoRender = mailgo => {
mailtoHref,
encEmail,
copyButton
),
false
)
);
};
@ -399,6 +396,7 @@ const mailgoKeydown = (
encEmail,
copyButton
) => {
console.log("keydown");
// if mailgo is not showing do nothing
if (!mailgoIsShowing()) return;
switch (event.keyCode) {