aboutsummaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/js/report.coffee14
1 files changed, 14 insertions, 0 deletions
diff --git a/public/js/report.coffee b/public/js/report.coffee
index 1aa085a6..7989c211 100644
--- a/public/js/report.coffee
+++ b/public/js/report.coffee
@@ -61,6 +61,7 @@ display = (transactions) ->
amount = received * exchange
notes = @notes
txid = @txid
+ address = @address
date = moment(@date, 'YYYY-MM-DD h:mm:ss').format('MMM D h:mma')
row = $("""
@@ -79,17 +80,30 @@ display = (transactions) ->
$('.report tbody').append(row)
row.click(->
+ $('#confirm, #yousure').hide()
+ $('#buttons, #modal textarea').show()
notes = $(this).attr('data-notes')
$('#modal').modal()
$('#modal textarea').val('')
+ $('#modal .btn-primary').toggle(address?)
$('#modal .btn-danger').off().click(->
+ $('#yousure, #confirm').show()
+ $('#buttons, #modal textarea').hide()
+ )
+
+ $('#confirm .btn-danger').click(->
$.ajax(type: 'delete', url: "/#{$('#user').val()}/transactions/#{txid}")
$('#modal').modal('hide')
row.remove()
)
+ $('#modal .btn-primary').off().click(->
+ window.open("https://blockchain.info/address/#{address}", '_blank')
+ $('#modal').modal('hide')
+ )
+
$('#modal textarea').off().change(->
notes = $(this).val()
$.post("/transactions/#{txid}", notes: $(this).val()) if txid