reload on empty page
This commit is contained in:
parent
9aafe0a011
commit
213ba00505
|
@ -50,16 +50,16 @@ $mailIdsJoinedString = filter_var(join('|', $mailIds), FILTER_SANITIZE_SPECIAL_C
|
||||||
function toggle_email_visibility(email_id) {
|
function toggle_email_visibility(email_id) {
|
||||||
var mailPreviewHeader = document.getElementById("email-preview-header-" + email_id);
|
var mailPreviewHeader = document.getElementById("email-preview-header-" + email_id);
|
||||||
var mailFullHeader = document.getElementById("email-fullheader-" + email_id);
|
var mailFullHeader = document.getElementById("email-fullheader-" + email_id);
|
||||||
var mailBoy = document.getElementById("email-content-" + email_id);
|
var mailBody = document.getElementById("email-content-" + email_id);
|
||||||
|
|
||||||
if (mailPreviewHeader.style.display !== 'none') {
|
if (mailPreviewHeader.style.display !== 'none') {
|
||||||
mailPreviewHeader.style.display = 'none';
|
mailPreviewHeader.style.display = 'none';
|
||||||
mailFullHeader.style.display = 'block';
|
mailFullHeader.style.display = 'block';
|
||||||
mailBoy.style.display = 'block';
|
mailBody.style.display = 'block';
|
||||||
} else {
|
} else {
|
||||||
mailPreviewHeader.style.display = 'block';
|
mailPreviewHeader.style.display = 'block';
|
||||||
mailFullHeader.style.display = 'none';
|
mailFullHeader.style.display = 'none';
|
||||||
mailBoy.style.display = 'none';
|
mailBody.style.display = 'none';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,6 +71,11 @@ $mailIdsJoinedString = filter_var(join('|', $mailIds), FILTER_SANITIZE_SPECIAL_C
|
||||||
if (r.responseText > 0) {
|
if (r.responseText > 0) {
|
||||||
console.log("There are", r.responseText, "new mails.");
|
console.log("There are", r.responseText, "new mails.");
|
||||||
document.getElementById("new-content-avalable").style.display = 'block';
|
document.getElementById("new-content-avalable").style.display = 'block';
|
||||||
|
|
||||||
|
// If there are no emails displayed, we can reload the page without loosing any state.
|
||||||
|
if(<?php echo count($emails)?> === 0) {
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
r.send();
|
r.send();
|
||||||
|
@ -302,4 +307,4 @@ $mailIdsJoinedString = filter_var(join('|', $mailIds), FILTER_SANITIZE_SPECIAL_C
|
||||||
| <a href="https://github.com/synox/disposable-mailbox">Contribute to the development on Github.</a></p>
|
| <a href="https://github.com/synox/disposable-mailbox">Contribute to the development on Github.</a></p>
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user