Change event triggered when canceling opes
This commit is contained in:
parent
84d478271b
commit
ce3d8aa6f7
6 changed files with 6 additions and 7 deletions
|
@ -1,5 +1,3 @@
|
||||||
var cancelHistory = new Event("history_cancel");
|
|
||||||
|
|
||||||
class KHistory {
|
class KHistory {
|
||||||
|
|
||||||
static get default_options() {
|
static get default_options() {
|
||||||
|
@ -72,7 +70,7 @@ class KHistory {
|
||||||
}
|
}
|
||||||
|
|
||||||
cancel_operations(to_cancel) {
|
cancel_operations(to_cancel) {
|
||||||
var on_success = () => document.dispatchEvent(cancelHistory);
|
var on_success = () => $(document).trigger("custom_reset");
|
||||||
|
|
||||||
api_with_auth({
|
api_with_auth({
|
||||||
url: Urls['kfet.kpsul.cancel_operations'](),
|
url: Urls['kfet.kpsul.cancel_operations'](),
|
||||||
|
|
|
@ -133,6 +133,7 @@ class Config {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var resetEvent = new Event("custom_reset");
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$(window).scroll(function() {
|
$(window).scroll(function() {
|
||||||
|
|
|
@ -43,7 +43,7 @@ class KPsulManager {
|
||||||
|
|
||||||
_init_events() {
|
_init_events() {
|
||||||
var that = this ;
|
var that = this ;
|
||||||
$(document).on("history_cancel", function(e) {
|
$(document).on("custom_reset", function(e) {
|
||||||
that.reset(true);
|
that.reset(true);
|
||||||
that.focus;
|
that.focus;
|
||||||
});
|
});
|
||||||
|
|
|
@ -109,7 +109,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
var khistory = new KHistory({'no_trigramme': true});
|
var khistory = new KHistory({'no_trigramme': true});
|
||||||
|
|
||||||
$(document).on("cancel_history", function(e) {
|
$(document).on("custom_reset", function(e) {
|
||||||
khistory.selection.reset();
|
khistory.selection.reset();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ $(document).ready(function() {
|
||||||
updateHistory();
|
updateHistory();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("cancel_history", function(e) {
|
$(document).on("custom_reset", function(e) {
|
||||||
khistory.selection.reset();
|
khistory.selection.reset();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
var history = new KHistory();
|
var history = new KHistory();
|
||||||
|
|
||||||
$(document).on("cancel_history", function(e) {
|
$(document).on("custom_reset", function(e) {
|
||||||
khistory.selection.reset();
|
khistory.selection.reset();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue