Module: check_mk
Branch: master
Commit: c5b6a14f1193ea08a5692654fe8e365804f334f7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c5b6a14f1193ea…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jun 20 20:29:47 2011 +0200
Dashboard: fixed dashlet positioning bug
---
web/htdocs/dashboard.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index 630c794..924f844 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -167,7 +167,9 @@ def ajax_resize():
n = []
for i in [0, 1]:
if self._data[i] < 0:
- n.append(size[i] - self._data[i] - 1)
+ # The following line had a bug that has been fixed thanks
+ # to Markus Lengler!
+ n.append(size[i] + self._data[i] - 1)
else:
n.append(self._data[i] - 1) # make begin from 0
return vec(n)
@@ -201,6 +203,7 @@ def ajax_resize():
# Compute the absolute position, this time from 0 to rastersize-1
abs_position = rel_position.make_absolute(rastersize)
+ file("/tmp/hirni", "a").write("D: %s: Rastersize: %s,
rel: %s, Pos: %s\n" % (dashlet.get("title"), rastersize, rel_position,
abs_position))
# The size in raster-elements. A 0 for a dimension means growth. No negative
values here.
size = vec(dashlet["size"])