Replace the reload on browser resize by a graph width resize

This commit is contained in:
Louis Bailleul
2015-11-27 11:58:56 +00:00
parent ef1c7a58e3
commit 094f7d50da
2 changed files with 23 additions and 3 deletions

View File

@ -1,3 +1,5 @@
var oldH;
var oldW;
$(document).ready(function() {
// Device override ajax calls
$("[name='override_config']").bootstrapSwitch('offColor','danger');
@ -123,6 +125,8 @@ $(document).ready(function() {
});
});
oldW=$(window).width();
oldH=$(window).height();
});
function submitCustomRange(frmdata) {
@ -144,14 +148,13 @@ function updateResolution()
height:$(window).height()
},
function(data) {
location.reload();
},'json'
);
}
var rtime;
var timeout = false;
var delta = 300;
var delta = 500;
$(window).on('resize', function(){
rtime = new Date();
@ -168,9 +171,26 @@ function resizeend() {
else {
timeout = false;
updateResolution();
resizeGraphs();
}
};
function resizeGraphs() {
newH=$(window).height();
newW=$(window).width();
ratioW=newW/oldW;
ratioH=newH/oldH;
$('.graphs').each(function (){
var img = jQuery(this);
img.attr('width',img.width() * ratioW);
});
oldH=newH;
oldW=newW;
}
$(document).on("click", '.collapse-neighbors', function(event)
{
var caller = $(this);