diff --git a/kfet/static/kfet/js/history.js b/kfet/static/kfet/js/history.js index d161e081..41c2f28f 100644 --- a/kfet/static/kfet/js/history.js +++ b/kfet/static/kfet/js/history.js @@ -76,7 +76,12 @@ class KHistory { } cancel_operations(to_cancel) { - var on_success = () => $(this).trigger("cancel_done"); + var that = this ; + var on_success = function() { + if (that.selection) + that.selection.reset() ; + $(that).trigger("cancel_done"); + } api_with_auth({ url: Urls['kfet.kpsul.cancel_operations'](), diff --git a/kfet/templates/kfet/account_read.html b/kfet/templates/kfet/account_read.html index 0ea0bdaa..58f1f4a9 100644 --- a/kfet/templates/kfet/account_read.html +++ b/kfet/templates/kfet/account_read.html @@ -104,10 +104,6 @@ $(document).ready(function() { var khistory = new KHistory({'no_trigramme': true}); - $(khistory).on("cancel_done", function(e) { - khistory.selection.reset(); - }); - Config.reset(() => khistory.fetch({'accounts': [{{account.pk}}]})); }); diff --git a/kfet/templates/kfet/history.html b/kfet/templates/kfet/history.html index 60e675d2..2075cf30 100644 --- a/kfet/templates/kfet/history.html +++ b/kfet/templates/kfet/history.html @@ -132,10 +132,6 @@ $(document).ready(function() { updateHistory(); }); - $(khistory).on("cancel_done", function(e) { - khistory.selection.reset(); - }); - Config.reset(updateHistory); }); diff --git a/kfet/templates/kfet/transfers.html b/kfet/templates/kfet/transfers.html index 500fcbc6..d94ae73b 100644 --- a/kfet/templates/kfet/transfers.html +++ b/kfet/templates/kfet/transfers.html @@ -53,10 +53,6 @@ $(document).ready(function() { var khistory = new KHistory(); - $(khistory).on("cancel_done", function(e) { - khistory.selection.reset(); - }); - Config.reset(() => khistory.fetch({'transfersonly': true})); });