Skip to content

Commit

Permalink
fix chart JS cache mismatches
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrDlouhy committed Jan 28, 2020
1 parent 843a341 commit 67bc8ca
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions admin_tools_stats/templates/admin_tools_stats/admin_charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ var html_string = '<svg style="width:{{chart_width}};height:{{chart_height}}px;"
var chart_scripts = {};

function loadChart(data, graph_key){
var storeToChartScripts = function(data_str) {
return function(data, textStatus, jqXHR) {
console.log("call " + data_str);
chart_scripts[data_str] = loadChartScript;
};
};

data_str = data.serialize();

if(data_str in chart_scripts){
Expand All @@ -14,10 +21,7 @@ function loadChart(data, graph_key){
dataType: "script",
'url': url,
'data': data.serialize(),
success: function(){
console.log("call " + data_str);
chart_scripts[data_str] = loadChartScript;
}
success: storeToChartScripts(data_str)
});
};
}
Expand Down

0 comments on commit 67bc8ca

Please sign in to comment.