Mail reply bug fixes
This commit is contained in:
parent
90bde92571
commit
e38340604a
18
index.html
18
index.html
@ -466,7 +466,7 @@
|
|||||||
<div id="mail_container"></div>
|
<div id="mail_container"></div>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<button class="button" id="prev_mail">View Previous Mail</button>
|
<button class="button" id="prev_mail">View Previous Mail</button>
|
||||||
<button class="button" id="show_reply_popup">reply</button>
|
<button class="button" id="show_reply_popup" onclick="openPopup('reply_mail_popup')">reply</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@ -738,7 +738,7 @@
|
|||||||
<sm-form>
|
<sm-form>
|
||||||
<sm-input id="subject_of_reply_mail" placeholder="Subject" animate></sm-input>
|
<sm-input id="subject_of_reply_mail" placeholder="Subject" animate></sm-input>
|
||||||
<sm-textarea id="reply_mail_content" placeholder="Type a mail" id="" rows="10" required></sm-textarea>
|
<sm-textarea id="reply_mail_content" placeholder="Type a mail" id="" rows="10" required></sm-textarea>
|
||||||
<button id="reply_mail_button" class="button button--primary" disabled>Send</button>
|
<button id="reply_mail_button" class="button button--primary" type="submit" disabled>Send</button>
|
||||||
</sm-form>
|
</sm-form>
|
||||||
</sm-popup>
|
</sm-popup>
|
||||||
<!-- Contact popup -->
|
<!-- Contact popup -->
|
||||||
@ -1429,6 +1429,10 @@
|
|||||||
}
|
}
|
||||||
renderElem(getRef('mail_contact_list'), html`${mailingContacts}`)
|
renderElem(getRef('mail_contact_list'), html`${mailingContacts}`)
|
||||||
break;
|
break;
|
||||||
|
case 'reply_mail_popup':
|
||||||
|
const { subject } = getRef('reply_mail_popup').dataset
|
||||||
|
getRef('subject_of_reply_mail').value = subject.startsWith("Re: ") ? subject : `Re: ${subject}`;
|
||||||
|
break;
|
||||||
case 'profile_popup':
|
case 'profile_popup':
|
||||||
renderElem(getRef('profile_popup__content'), render.profile())
|
renderElem(getRef('profile_popup__content'), render.profile())
|
||||||
break;
|
break;
|
||||||
@ -3688,10 +3692,6 @@
|
|||||||
|
|
||||||
getRef('add_contact_button').addEventListener("click", addContact)
|
getRef('add_contact_button').addEventListener("click", addContact)
|
||||||
|
|
||||||
getRef('show_reply_popup').addEventListener("click", () => {
|
|
||||||
openPopup('reply_mail_popup')
|
|
||||||
})
|
|
||||||
|
|
||||||
getRef('reply_mail_button').addEventListener("click", replyMail)
|
getRef('reply_mail_button').addEventListener("click", replyMail)
|
||||||
|
|
||||||
getRef("backup_data").addEventListener("click", function (e) {
|
getRef("backup_data").addEventListener("click", function (e) {
|
||||||
@ -4268,8 +4268,7 @@
|
|||||||
if (newView) {
|
if (newView) {
|
||||||
getRef('reply_mail_popup').dataset["to"] = (from === floDapps.user.id ? to.join(',') : from)
|
getRef('reply_mail_popup').dataset["to"] = (from === floDapps.user.id ? to.join(',') : from)
|
||||||
getRef('reply_mail_popup').dataset["prev"] = mailRef;
|
getRef('reply_mail_popup').dataset["prev"] = mailRef;
|
||||||
getRef('subject_of_reply_mail').value = subject.startsWith("Re: ") ? subject : `Re: ${subject}`;
|
getRef('reply_mail_popup').dataset["subject"] = subject.startsWith("Re: ") ? subject : `Re: ${subject}`;
|
||||||
getRef("show_reply_popup").classList.remove("hidden");
|
|
||||||
}
|
}
|
||||||
messenger.removeMark(mailRef, "unread");
|
messenger.removeMark(mailRef, "unread");
|
||||||
location.hash = `#/mail_page/${getRef("mail_type_selector").value}/mail`
|
location.hash = `#/mail_page/${getRef("mail_type_selector").value}/mail`
|
||||||
@ -4303,12 +4302,11 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
function replyMail() {
|
function replyMail() {
|
||||||
let recipient = getRef('reply_mail_popup').dataset.to;
|
let { to: recipient, prev } = getRef('reply_mail_popup').dataset;
|
||||||
if (recipient.includes(','))
|
if (recipient.includes(','))
|
||||||
recipient = recipient.split(',')
|
recipient = recipient.split(',')
|
||||||
let subject = getRef('subject_of_reply_mail').value;
|
let subject = getRef('subject_of_reply_mail').value;
|
||||||
let content = getRef('reply_mail_content').value;
|
let content = getRef('reply_mail_content').value;
|
||||||
let prev = getRef('reply_mail_popup').dataset.prev;
|
|
||||||
messenger.sendMail(subject, content, recipient, prev).then(result => {
|
messenger.sendMail(subject, content, recipient, prev).then(result => {
|
||||||
notify(`Mail replied!`);
|
notify(`Mail replied!`);
|
||||||
renderMailList(result)
|
renderMailList(result)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user