diff --git a/html/ajax_setresolution.php b/html/ajax_setresolution.php
index 3bf071e52..e2dc12eba 100644
--- a/html/ajax_setresolution.php
+++ b/html/ajax_setresolution.php
@@ -4,6 +4,3 @@ if(isset($_REQUEST['width']) AND isset($_REQUEST['height'])) {
$_SESSION['screen_width'] = $_REQUEST['width'];
$_SESSION['screen_height'] = $_REQUEST['height'];
}
-
-echo $_SESSION['screen_width'];
-?>
diff --git a/html/includes/print-graphrow.inc.php b/html/includes/print-graphrow.inc.php
index d3000844f..0e4c7d9d0 100644
--- a/html/includes/print-graphrow.inc.php
+++ b/html/includes/print-graphrow.inc.php
@@ -37,19 +37,15 @@ else {
);
}//end if
-if($_SESSION['screen_width'])
-{
- if($_SESSION['screen_width'] >= 800)
- {
+if($_SESSION['screen_width']) {
+ if($_SESSION['screen_width'] >= 800) {
$graph_array['width'] = ($_SESSION['screen_width'] - 400 )/count($periods)+1;
- }else
- {
+ }else {
$graph_array['width'] = $_SESSION['screen_width'] - 155;
}
}
-if($_SESSION['screen_height'])
-{
+if($_SESSION['screen_height']) {
$graph_array['height'] = ($_SESSION['screen_height'] - 250)/4;
}
diff --git a/html/js/librenms.js b/html/js/librenms.js
index f84dad6f3..3918c14a9 100644
--- a/html/js/librenms.js
+++ b/html/js/librenms.js
@@ -137,6 +137,18 @@ function submitCustomRange(frmdata) {
return true;
}
+function updateResolution()
+{
+ $.post(
+ 'ajax_setresolution.php',
+ {width: $(window).width(),height:$(window).height()},
+ function(json) {},
+ 'json'
+ );
+}
+
+$(window).on('resize', function(){ updateResolution();});
+
$(document).on("click", '.collapse-neighbors', function(event)
{
var caller = $(this);
@@ -144,11 +156,9 @@ $(document).on("click", '.collapse-neighbors', function(event)
var list = caller.find('.neighbors-interface-list');
var continued = caller.find('.neighbors-list-continued');
- if(button.hasClass("glyphicon-plus"))
- {
+ if(button.hasClass("glyphicon-plus")) {
button.addClass('glyphicon-minus').removeClass('glyphicon-plus');
- }else
- {
+ }else {
button.addClass('glyphicon-plus').removeClass('glyphicon-minus');
}
@@ -156,12 +166,4 @@ $(document).on("click", '.collapse-neighbors', function(event)
continued.toggle();
});
-function updateResolution()
-{
- $.post('ajax_setresolution.php', { width: $(window).width() , height:$(window).height() }, function(json) {
- },'json');
-}
-
-$(window).on('resize', function(){ updateResolution();});
-