highlight original on amend...
parent
518909b7f7
commit
6c66b6debb
|
|
@ -5,6 +5,9 @@
|
|||
input[type="text"] {
|
||||
border: 1px solid black;
|
||||
}
|
||||
.amended {
|
||||
border: 2px solid green;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function http(method, remote, callback, body) {
|
||||
|
|
@ -40,12 +43,15 @@
|
|||
load()
|
||||
}
|
||||
|
||||
function load() {
|
||||
function load(callback) {
|
||||
http("GET", "/api/transactions" /*?f="+f*/, (body, status) => {
|
||||
var d = JSON.parse(body)
|
||||
console.log("loading", d)
|
||||
loadBalances(d.balances)
|
||||
loadTransactions(d.transactions)
|
||||
if (callback != null) {
|
||||
callback()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +71,7 @@
|
|||
|
||||
var result = `<table>`
|
||||
for (var t of transactions) {
|
||||
result += `<tr transaction='${btoa(JSON.stringify(t))}' style="cursor: crosshair;" onclick="stageEdit(this); return false;">`
|
||||
result += `<tr id="transaction-${t[0].Transaction}" transaction='${btoa(JSON.stringify(t))}' style="cursor: crosshair;" onclick="stageEdit(this); return false;">`
|
||||
result += ` <td style="width: 6em;">${t[0].Date}</td>`
|
||||
result += ` <td style="width: 10em;">${t[0].Description}</td>`
|
||||
result += ` <td><table style="margin: 0;">`
|
||||
|
|
@ -150,7 +156,9 @@
|
|||
http("PUT", "/api/amend", (body, status) => {
|
||||
if (status != 200)
|
||||
throw(`Unexpected status ${status}: ${body}`)
|
||||
load()
|
||||
load(() => {
|
||||
document.getElementById(`transaction-${now.Transaction}`).className = "amended"
|
||||
})
|
||||
}, JSON.stringify({
|
||||
old: old,
|
||||
now: now,
|
||||
|
|
|
|||
Loading…
Reference in New Issue