fix bug with keydownlistener
This commit is contained in:
parent
f5d7bef15c
commit
ca785d6be8
7
dist/mailgo.js
vendored
7
dist/mailgo.js
vendored
@ -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
2
dist/mailgo.min.js
vendored
File diff suppressed because one or more lines are too long
@ -289,21 +289,18 @@ const mailgoRender = mailgo => {
|
||||
showMailgo();
|
||||
|
||||
// listener keyDown
|
||||
mailgo.addEventListener(
|
||||
"keydown",
|
||||
() =>
|
||||
mailgoKeydown(
|
||||
mail,
|
||||
cc,
|
||||
bcc,
|
||||
subject,
|
||||
bodyMail,
|
||||
url,
|
||||
mailtoHref,
|
||||
encEmail,
|
||||
copyButton
|
||||
),
|
||||
false
|
||||
document.addEventListener("keydown", () =>
|
||||
mailgoKeydown(
|
||||
mail,
|
||||
cc,
|
||||
bcc,
|
||||
subject,
|
||||
bodyMail,
|
||||
url,
|
||||
mailtoHref,
|
||||
encEmail,
|
||||
copyButton
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
@ -399,6 +396,7 @@ const mailgoKeydown = (
|
||||
encEmail,
|
||||
copyButton
|
||||
) => {
|
||||
console.log("keydown");
|
||||
// if mailgo is not showing do nothing
|
||||
if (!mailgoIsShowing()) return;
|
||||
switch (event.keyCode) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user