changed the behaviour of telegram, now available only with username
This commit is contained in:
parent
8a900e1e23
commit
a186989885
@ -29,7 +29,8 @@ let url = "",
|
|||||||
|
|
||||||
// mailgo tel variables
|
// mailgo tel variables
|
||||||
let tel = "",
|
let tel = "",
|
||||||
msg = "";
|
msg = "",
|
||||||
|
telegramUsername = "";
|
||||||
|
|
||||||
// mailgo buttons
|
// mailgo buttons
|
||||||
let gmailButton,
|
let gmailButton,
|
||||||
@ -230,6 +231,10 @@ const mailgoInit = () => {
|
|||||||
telegram.href = "#mailgo-telegram";
|
telegram.href = "#mailgo-telegram";
|
||||||
telegram.classList.add("mailgo-open");
|
telegram.classList.add("mailgo-open");
|
||||||
telegram.classList.add("mailgo-telegram");
|
telegram.classList.add("mailgo-telegram");
|
||||||
|
|
||||||
|
// by default not display
|
||||||
|
telegram.style.display = "none";
|
||||||
|
|
||||||
let telegramContent = document.createTextNode("open in ");
|
let telegramContent = document.createTextNode("open in ");
|
||||||
telegram.appendChild(telegramContent);
|
telegram.appendChild(telegramContent);
|
||||||
let telegramSpan = document.createElement("span");
|
let telegramSpan = document.createElement("span");
|
||||||
@ -437,12 +442,21 @@ const mailgoRender = (type = MAIL_TYPE, mailgo) => {
|
|||||||
// information
|
// information
|
||||||
let titleEl = getE("mailgo-tel-title");
|
let titleEl = getE("mailgo-tel-title");
|
||||||
|
|
||||||
|
// Telegram username
|
||||||
|
if (mailgo.hasAttribute("data-telegram")) {
|
||||||
|
telegramUsername = mailgo.getAttribute("data-telegram");
|
||||||
|
}
|
||||||
|
|
||||||
// actions
|
// actions
|
||||||
waButton = getE("mailgo-wa");
|
waButton = getE("mailgo-wa");
|
||||||
telegramButton = getE("mailgo-telegram");
|
telegramButton = getE("mailgo-telegram");
|
||||||
callButton = getE("mailgo-call");
|
callButton = getE("mailgo-call");
|
||||||
copyButton = getE("mailgo-tel-copy");
|
copyButton = getE("mailgo-tel-copy");
|
||||||
|
|
||||||
|
if (telegramUsername) {
|
||||||
|
telegramButton.setDisplay("block");
|
||||||
|
}
|
||||||
|
|
||||||
// the title of the modal (tel)
|
// the title of the modal (tel)
|
||||||
titleEl.innerHTML = tel;
|
titleEl.innerHTML = tel;
|
||||||
|
|
||||||
@ -508,7 +522,7 @@ const actions = {
|
|||||||
|
|
||||||
openTelegram: () => {
|
openTelegram: () => {
|
||||||
// Telegram url
|
// Telegram url
|
||||||
let tgUrl = "https://t.me/" + tel;
|
let tgUrl = "https://t.me/" + telegramUsername;
|
||||||
// open the url
|
// open the url
|
||||||
window.open(tgUrl, "_blank");
|
window.open(tgUrl, "_blank");
|
||||||
// hide the modal
|
// hide the modal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user