Add selection reset to cancel_opes

This commit is contained in:
Ludovic Stephan 2017-05-15 21:10:39 -03:00
parent 43e772363e
commit 6a6fc38ead
4 changed files with 6 additions and 13 deletions

View file

@ -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'](),

View file

@ -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}}]}));
});
</script>

View file

@ -132,10 +132,6 @@ $(document).ready(function() {
updateHistory();
});
$(khistory).on("cancel_done", function(e) {
khistory.selection.reset();
});
Config.reset(updateHistory);
});
</script>

View file

@ -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}));
});