send data for cancel

This commit is contained in:
Ludovic Stephan 2016-12-10 23:52:26 -02:00
parent 0b61a48c65
commit 2c2da60e54
2 changed files with 7 additions and 5 deletions

View file

@ -22,7 +22,6 @@ function KHistory(options={}) {
$opegroup.after($ope); $opegroup.after($ope);
} }
} else { } else {
$opegroup.addClass("transfergroup");
for (var i=0; i<opegroup['opes'].length; i++) { for (var i=0; i<opegroup['opes'].length; i++) {
var $transfer = this._transferHtml(opegroup['opes'][i]); var $transfer = this._transferHtml(opegroup['opes'][i]);
$transfer.data('transfergroup', opegroup['id']); $transfer.data('transfergroup', opegroup['id']);
@ -50,7 +49,8 @@ function KHistory(options={}) {
} }
$ope_html $ope_html
.data('ope', ope['id']) .data('type', 'ope')
.data('id', ope['id'])
.find('.amount').text(amount).end() .find('.amount').text(amount).end()
.find('.infos1').text(infos1).end() .find('.infos1').text(infos1).end()
.find('.infos2').text(infos2).end(); .find('.infos2').text(infos2).end();
@ -73,7 +73,8 @@ function KHistory(options={}) {
var amount = parsed_amount.toFixed(2) + '€'; var amount = parsed_amount.toFixed(2) + '€';
$transfer_html $transfer_html
.data('transfer', transfer['id']) .data('type', 'transfer')
.data('id', transfer['id'])
.find('.amount').text(amount).end() .find('.amount').text(amount).end()
.find('.infos1').text(transfer['from_acc']).end() .find('.infos1').text(transfer['from_acc']).end()
.find('.infos2').text(transfer['to_acc']).end(); .find('.infos2').text(transfer['to_acc']).end();
@ -115,7 +116,8 @@ function KHistory(options={}) {
var comment = opegroup['comment'] || ''; var comment = opegroup['comment'] || '';
$opegroup_html $opegroup_html
.data(type, opegroup['id']) .data('type', type)
.data('id', opegroup['id'])
.find('.time').text(at).end() .find('.time').text(at).end()
.find('.trigramme').text(trigramme).end() .find('.trigramme').text(trigramme).end()
.find('.info').text("Transferts").end() .find('.info').text("Transferts").end()

View file

@ -157,7 +157,7 @@ $(document).ready(function() {
// DEL (Suppr) // DEL (Suppr)
var opes_to_cancel = []; var opes_to_cancel = [];
khistory.$container.find('.ope.ui-selected').each(function () { khistory.$container.find('.ope.ui-selected').each(function () {
opes_to_cancel.push($(this).data('ope')); opes_to_cancel.push($(this).data('type')+' '+$(this).data('id'));
}); });
if (opes_to_cancel.length > 0) if (opes_to_cancel.length > 0)
confirmCancel(opes_to_cancel); confirmCancel(opes_to_cancel);