mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-18 10:16:49 +00:00
Introduce clone and edit button.
This commit is contained in:
@@ -24,6 +24,7 @@ $(document).ready(function () {
|
||||
updateListButtons();
|
||||
addSort();
|
||||
$('.clone-transaction').click(cloneTransaction);
|
||||
$('.clone-transaction-and-edit').click(cloneTransactionAndEdit);
|
||||
});
|
||||
|
||||
var fixHelper = function (e, tr) {
|
||||
@@ -242,3 +243,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;
|
||||
}
|
||||
|
@@ -48,4 +48,5 @@ function presentSearchResults(data) {
|
||||
updateListButtons();
|
||||
// want to clone?
|
||||
$('.clone-transaction').click(cloneTransaction);
|
||||
}
|
||||
$('.clone-transaction-and-edit').click(cloneTransactionAndEdit);
|
||||
}
|
||||
|
@@ -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