Module: check_mk
Branch: master
Commit: 2bbeae1579e71286caf4621b49b9b71579f6f831
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2bbeae1579e712…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Aug 16 09:59:58 2011 +0200
Dashboard: Caring about body padding now
---
web/htdocs/dashboard.py | 3 +--
web/htdocs/js/dashboard.js | 12 ++++++++----
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index 7d5defb..ac3a492 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -252,8 +252,7 @@ def ajax_resize():
board = dashboards[html.var("name")]
- screensize = vec((int(html.var("width")) - 2*screen_margin,
- int(html.var("height")) - 2*screen_margin -
header_height))
+ screensize = vec((int(html.var("width")),
int(html.var("height"))))
rastersize = screensize / raster
used_matrix = {} # keep track of used raster elements
diff --git a/web/htdocs/js/dashboard.js b/web/htdocs/js/dashboard.js
index 685095b..adb8bb4 100644
--- a/web/htdocs/js/dashboard.js
+++ b/web/htdocs/js/dashboard.js
@@ -72,14 +72,18 @@ function resize_dashlets(id, code)
function set_dashboard_size()
{
- var width = pageWidth();
+ var body_padding = 10;
+ var width = pageWidth();
var height = pageHeight();
+ width = width - 2*screen_margin - 2*body_padding;
+ height = height - 2*screen_margin - header_height - body_padding;
+
oDash = document.getElementById("dashboard");
oDash.style.position = 'absolute';
oDash.style.left = screen_margin + "px";
- oDash.style.top = header_height + screen_margin + "px";
- oDash.style.width = width - 2*screen_margin + "px";
- oDash.style.height = height - 2*screen_margin - header_height + "px";
+ oDash.style.top = (header_height + screen_margin) + "px";
+ oDash.style.width = width + "px";
+ oDash.style.height = height + "px";
ajax_url = 'dashboard_resize.py?name=' + dashboard_name
+ '&width=' + width