mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 01:57:02 +00:00
Handle missing .raw better, closes #19
- Add filestore unit tests to exercise #19 - Move deferred file close under error check - Handle error message from server gracefully on message click - Scroll to top of page when message loads successfully
This commit is contained in:
@@ -4,6 +4,14 @@
|
||||
{{define "script"}}
|
||||
<script>
|
||||
var selected = "{{.selected}}"
|
||||
function messageLoaded(responseText, textStatus, XMLHttpRequest) {
|
||||
if (textStatus == "error") {
|
||||
alert("Failed to load message, server said:\n" + responseText)
|
||||
} else {
|
||||
window.scrollTo(0,0)
|
||||
}
|
||||
}
|
||||
|
||||
function listLoaded() {
|
||||
$('.listEntry').hover(
|
||||
function() {
|
||||
@@ -16,7 +24,7 @@
|
||||
function() {
|
||||
$('.listEntry').removeClass("listEntrySelected")
|
||||
$(this).addClass("listEntrySelected")
|
||||
$('#emailContent').load('/mailbox/{{.name}}/' + this.id)
|
||||
$('#emailContent').load('/mailbox/{{.name}}/' + this.id, messageLoaded)
|
||||
}
|
||||
)
|
||||
$("#messageList").slideDown()
|
||||
|
||||
Reference in New Issue
Block a user