aboutsummaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2014-09-01 16:00:19 -0700
committerAdam Soltys <[email protected]>2014-09-01 16:00:19 -0700
commit9fa89028a9475bbd05534c20c6b49c5820900a25 (patch)
treea406df447d9138fd54d81914e1f9aaba5fd66943 /public
parent4e5d09cfe0e62ecde31482f3563277b3585860f9 (diff)
downloadcoinos-server-9fa89028a9475bbd05534c20c6b49c5820900a25.tar.gz
coinos-server-9fa89028a9475bbd05534c20c6b49c5820900a25.zip
Confirm transaction delete
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