From 2eba6892a2cfdc4cf276a54de65e9b3751d6a62c Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Mon, 10 Apr 2017 15:34:57 -0300 Subject: [PATCH] Revert "Change event triggered when canceling opes" This reverts commit ce3d8aa6f7025881aba002f23dfc23604bc07cf5. --- kfet/static/kfet/js/history.js | 4 +++- kfet/static/kfet/js/kfet.js | 1 - kfet/static/kfet/js/kpsul.js | 2 +- kfet/templates/kfet/account_read.html | 2 +- kfet/templates/kfet/history.html | 2 +- kfet/templates/kfet/transfers.html | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/kfet/static/kfet/js/history.js b/kfet/static/kfet/js/history.js index 6231c678..5b6ec75b 100644 --- a/kfet/static/kfet/js/history.js +++ b/kfet/static/kfet/js/history.js @@ -1,3 +1,5 @@ +var cancelHistory = new Event("history_cancel"); + class KHistory { static get default_options() { @@ -70,7 +72,7 @@ class KHistory { } cancel_operations(to_cancel) { - var on_success = () => $(document).trigger("custom_reset"); + var on_success = () => document.dispatchEvent(cancelHistory); 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 81f8e845..a2b245cf 100644 --- a/kfet/static/kfet/js/kfet.js +++ b/kfet/static/kfet/js/kfet.js @@ -133,7 +133,6 @@ 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 e42d5569..8833d072 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("custom_reset", function(e) { + $(document).on("history_cancel", function(e) { that.reset(true); that.focus; }); diff --git a/kfet/templates/kfet/account_read.html b/kfet/templates/kfet/account_read.html index 8991162e..54b91de4 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("custom_reset", function(e) { + $(document).on("cancel_history", function(e) { khistory.selection.reset(); }); diff --git a/kfet/templates/kfet/history.html b/kfet/templates/kfet/history.html index 4edb233a..d432079f 100644 --- a/kfet/templates/kfet/history.html +++ b/kfet/templates/kfet/history.html @@ -129,7 +129,7 @@ $(document).ready(function() { updateHistory(); }); - $(document).on("custom_reset", function(e) { + $(document).on("cancel_history", function(e) { khistory.selection.reset(); }); diff --git a/kfet/templates/kfet/transfers.html b/kfet/templates/kfet/transfers.html index 49f36327..910c5ab9 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("custom_reset", function(e) { + $(document).on("cancel_history", function(e) { khistory.selection.reset(); });