WIP: Aureplop/kpsul js refactor #501
2 changed files with 6 additions and 10 deletions
|
@ -102,18 +102,15 @@
|
|||
$(document).ready(function() {
|
||||
'use strict';
|
||||
|
||||
// Lock to avoid multiple requests
|
||||
window.lock = 0;
|
||||
|
||||
var history = new KHistory({'remove_props': ['trigramme']});
|
||||
var khistory = new KHistory({'remove_props': ['trigramme']});
|
||||
|
||||
// -----
|
||||
// Synchronization
|
||||
// -----
|
||||
|
||||
OperationWebSocket.add_handler((data) => history.update_data(data));
|
||||
OperationWebSocket.add_handler((data) => khistory.update_data(data));
|
||||
|
||||
Config.reset(() => history.fetch({'accounts': [{{account.pk}}]}));
|
||||
Config.reset(() => khistory.fetch({'accounts': [{{account.pk}}]}));
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -64,8 +64,7 @@
|
|||
$(document).ready(function() {
|
||||
'use strict';
|
||||
|
||||
|
||||
var history = new KHistory();
|
||||
var khistory = new KHistory();
|
||||
|
||||
var $from_date = $('#from_date');
|
||||
var $to_date = $('#to_date');
|
||||
|
@ -95,7 +94,7 @@ $(document).ready(function() {
|
|||
data['accounts'] = accounts;
|
||||
|
||||
// Update history
|
||||
history.fetch(data);
|
||||
khistory.fetch(data);
|
||||
}
|
||||
|
||||
$('#from_date').datetimepicker({
|
||||
|
@ -134,7 +133,7 @@ $(document).ready(function() {
|
|||
// Synchronization
|
||||
// -----
|
||||
|
||||
OperationWebSocket.add_handler(data => history.update_data(data));
|
||||
OperationWebSocket.add_handler(data => khistory.update_data(data));
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue