mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 03:53:37 +00:00
Expand views and JS.
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
$(document).ready(function () {
|
||||
$('.relateTransaction').click(relateTransaction);
|
||||
$('.unrelate-checkbox').click(unrelateTransaction);
|
||||
|
||||
});
|
||||
|
||||
function unrelateTransaction(e) {
|
||||
var target = $(e.target);
|
||||
var id = target.data('id');
|
||||
var relatedTo = target.data('relatedto');
|
||||
|
||||
$.post('transactions/unrelate/' + relatedTo, {relation: id}).success(function (data) {
|
||||
target.parent().parent().remove();
|
||||
}).fail(function () {
|
||||
alert('Could not!');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function relateTransaction(e) {
|
||||
var target = $(e.target);
|
||||
var ID = target.data('id');
|
||||
@@ -12,7 +26,6 @@ function relateTransaction(e) {
|
||||
$('#relationModal').empty().load('transaction/relate/' + ID, function () {
|
||||
|
||||
$('#relationModal').modal('show');
|
||||
console.log($('#searchRelated').length + '!');
|
||||
getAlreadyRelatedTransactions(e, ID);
|
||||
$('#searchRelated').submit(function (e) {
|
||||
searchRelatedTransactions(e, ID);
|
||||
@@ -20,7 +33,6 @@ function relateTransaction(e) {
|
||||
return false;
|
||||
});
|
||||
});
|
||||
console.log($('#searchRelated').length);
|
||||
|
||||
|
||||
return false;
|
||||
|
@@ -18,16 +18,4 @@ $(document).ready(function () {
|
||||
if(typeof googleTablePaged != 'undefined') {
|
||||
googleTablePaged('table/transactions/' + what,'transaction-table');
|
||||
}
|
||||
if($('#relateTransaction').length == 1) {
|
||||
$('#relateTransaction').click(relateTransaction);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function relateTransaction(e) {
|
||||
var target = $(e.target);
|
||||
var ID = target.data('id');
|
||||
alert("TODO remove me");
|
||||
$('#relationModal').empty().load('transaction/relate/' + ID).modal('show');
|
||||
return false;
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user