Adapte history.js pour serialize()

This commit is contained in:
Ludovic Stephan 2020-09-15 20:05:32 +02:00
parent c7998f56f0
commit a9eb32217f

View file

@ -205,17 +205,21 @@ function KHistory(options = {}) {
$group.find('.amount').text(amount);
}
this.fetch = function (fetch_options) {
options = $.extend({}, this.fetch_options, fetch_options);
var that = this;
this.fetch = function (fetch_options = {}) {
if (typeof (fetch_options) == "string")
data = fetch_options
else
data = $.extend({}, this.fetch_options, fetch_options);
return $.ajax({
context: this,
dataType: "json",
url: django_urls["kfet.history.json"](),
method: "POST",
data: options,
method: "GET",
data: data,
}).done(function (data) {
for (let group of data['groups']) {
that.add_history_group(group);
this.add_history_group(group);
}
});
}