mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 09:52:20 +00:00
Introduce clone and edit button.
This commit is contained in:
@@ -22,6 +22,7 @@ $(function () {
|
||||
"use strict";
|
||||
$('.link-modal').click(getLinkModal);
|
||||
$('.clone-transaction').click(cloneTransaction);
|
||||
$('.clone-transaction-and-edit').click(cloneTransactionAndEdit);
|
||||
$('#linkJournalModal').on('shown.bs.modal', function () {
|
||||
makeAutoComplete();
|
||||
})
|
||||
@@ -94,3 +95,18 @@ function cloneTransaction(e) {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function cloneTransactionAndEdit(e) {
|
||||
var button = $(e.currentTarget);
|
||||
var groupId = parseInt(button.data('id'));
|
||||
|
||||
$.post(cloneAndEditUrl, {
|
||||
id: groupId
|
||||
}).done(function (data) {
|
||||
// lame but it works
|
||||
location.href = data.redirect;
|
||||
}).fail(function () {
|
||||
console.error('I failed :(');
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user