Module: check_mk
Branch: master
Commit: e98dcf3d6d1b02c55a222f60c8de465a8ea1c484
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e98dcf3d6d1b02…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 27 11:35:57 2010 +0100
Sidebar: Fixed scroll position saving in Opera
---
.bugs/18 | 10 +++++++---
ChangeLog | 1 +
web/htdocs/js/sidebar.js | 11 +++++++++++
web/htdocs/sidebar.py | 2 +-
4 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/.bugs/18 b/.bugs/18
index 6cb4c2a..a191bac 100644
--- a/.bugs/18
+++ b/.bugs/18
@@ -1,10 +1,11 @@
Title: Browserprobleme bei Opera
Component: multisite
+State: done
+Class: bug
+Date: 2010-12-21 16:18:53
Benefit: 1
-State: open
Cost: 3
-Date: 2010-12-21 16:18:53
-Class: bug
+Fun: 0
* Bei Opera kann man kein Snapin nach ganz unten ziehen. Der Indikator
springt dann immer nach ganz oben.
@@ -13,3 +14,6 @@ springt dann immer nach ganz oben.
* Im Opera wird sich die aktuelle Scroll-Position der Sidebar nicht korrekt
gemerkt.
+
+2010-12-27 11:35:44: changed state open -> done
+Things are working now in current opera version
\ No newline at end of file
diff --git a/ChangeLog b/ChangeLog
index 26127f8..130dc30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,7 @@
* new view "Alert Statistics" showing alert statistics for all hosts
and services
* Sidebar: Fixed snapin movement to the bottom of the snapin list in Opera
+ * Sidebar: Fixed scroll position saving in Opera
Checks & Agents:
* Fixed problem with OnlyFrom: in Linux agent (df didn't work properly)
diff --git a/web/htdocs/js/sidebar.js b/web/htdocs/js/sidebar.js
index 9eff28d..ab971cb 100644
--- a/web/htdocs/js/sidebar.js
+++ b/web/htdocs/js/sidebar.js
@@ -24,6 +24,7 @@
var browser = navigator.userAgent.toLowerCase();
var weAreIEF__k = ((browser.indexOf("msie") != -1) &&
(browser.indexOf("opera") == -1));
+var weAreOpera = browser.indexOf("opera") != -1;
var weAreFirefox = browser.indexOf("firefox") != -1 ||
browser.indexOf("namoroka") != -1;
var contentLocation = parent.frames[1].document.location;
@@ -456,6 +457,11 @@ function dragScroll(event) {
var diff = startY - event.clientY;
inhalt.scrollTop += diff;
+
+ // Opera does not fire onunload event which is used to store the scroll
+ // position. So call the store function manually here.
+ if(weAreOpera)
+ storeScrollPos();
startY = event.clientY;
@@ -496,6 +502,11 @@ function scrollWheel(event){
if (delta)
handle(delta);
+ // Opera does not fire onunload event which is used to store the scroll
+ // position. So call the store function manually here.
+ if(weAreOpera)
+ storeScrollPos();
+
if (event.preventDefault)
event.preventDefault();
else
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index 53efd52..1403ebe 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -130,7 +130,7 @@ def page_side(h):
global html
html = h
- html.write("""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Frameset//EN "http://www.w3.org/TR/html4/frameset.dtd">
+ html.write("""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>