mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Add reload on resize event to regenerate the graphs correctly
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user