Add reload on resize event to regenerate the graphs correctly

This commit is contained in:
Louis Bailleul
2015-11-26 12:14:57 +00:00
parent a62067a5b9
commit 4d6e194a52
2 changed files with 30 additions and 6 deletions

View File

@@ -139,15 +139,37 @@ function submitCustomRange(frmdata) {
function updateResolution()
{
$.post(
'ajax_setresolution.php',
{width: $(window).width(),height:$(window).height()},
function(json) {},
'json'
$.post('ajax_setresolution.php',
{
width: $(window).width(),
height:$(window).height()
},
function(data) {
location.reload();
},'json'
);
}
$(window).on('resize', function(){ updateResolution();});
var rtime;
var timeout = false;
var delta = 300;
$(window).on('resize', function(){
rtime = new Date();
if (timeout === false) {
timeout = true;
setTimeout(resizeend, delta);
}
});
function resizeend() {
if (new Date() - rtime < delta) {
setTimeout(resizeend, delta);
} else {
timeout = false;
updateResolution();
}
};
$(document).on("click", '.collapse-neighbors', function(event)
{