diff --git a/kfet/static/kfet/js/history.js b/kfet/static/kfet/js/history.js index 5b6ec75b..6231c678 100644 --- a/kfet/static/kfet/js/history.js +++ b/kfet/static/kfet/js/history.js @@ -1,5 +1,3 @@ -var cancelHistory = new Event("history_cancel"); - class KHistory { static get default_options() { @@ -72,7 +70,7 @@ class KHistory { } cancel_operations(to_cancel) { - var on_success = () => document.dispatchEvent(cancelHistory); + var on_success = () => $(document).trigger("custom_reset"); api_with_auth({ url: Urls['kfet.kpsul.cancel_operations'](), diff --git a/kfet/static/kfet/js/kfet.js b/kfet/static/kfet/js/kfet.js index a2b245cf..81f8e845 100644 --- a/kfet/static/kfet/js/kfet.js +++ b/kfet/static/kfet/js/kfet.js @@ -133,6 +133,7 @@ class Config { } +var resetEvent = new Event("custom_reset"); $(document).ready(function() { $(window).scroll(function() { diff --git a/kfet/static/kfet/js/kpsul.js b/kfet/static/kfet/js/kpsul.js index 8833d072..e42d5569 100644 --- a/kfet/static/kfet/js/kpsul.js +++ b/kfet/static/kfet/js/kpsul.js @@ -43,7 +43,7 @@ class KPsulManager { _init_events() { var that = this ; - $(document).on("history_cancel", function(e) { + $(document).on("custom_reset", function(e) { that.reset(true); that.focus; }); diff --git a/kfet/templates/kfet/account_read.html b/kfet/templates/kfet/account_read.html index 54b91de4..8991162e 100644 --- a/kfet/templates/kfet/account_read.html +++ b/kfet/templates/kfet/account_read.html @@ -109,7 +109,7 @@ $(document).ready(function() { var khistory = new KHistory({'no_trigramme': true}); - $(document).on("cancel_history", function(e) { + $(document).on("custom_reset", function(e) { khistory.selection.reset(); }); diff --git a/kfet/templates/kfet/history.html b/kfet/templates/kfet/history.html index d432079f..4edb233a 100644 --- a/kfet/templates/kfet/history.html +++ b/kfet/templates/kfet/history.html @@ -129,7 +129,7 @@ $(document).ready(function() { updateHistory(); }); - $(document).on("cancel_history", function(e) { + $(document).on("custom_reset", function(e) { khistory.selection.reset(); }); diff --git a/kfet/templates/kfet/transfers.html b/kfet/templates/kfet/transfers.html index 910c5ab9..49f36327 100644 --- a/kfet/templates/kfet/transfers.html +++ b/kfet/templates/kfet/transfers.html @@ -53,7 +53,7 @@ $(document).ready(function() { var history = new KHistory(); - $(document).on("cancel_history", function(e) { + $(document).on("custom_reset", function(e) { khistory.selection.reset(); });