From a63361fe6d5e0e60de7f1681da7e628b13639820 Mon Sep 17 00:00:00 2001
From: rudolfkoenig <>
Date: Sat, 19 Oct 2013 11:10:12 +0000
Subject: [PATCH] FHEMWEB: Auto-Scroll in Event-Monitor (by Markus)

git-svn-id: https://svn.fhem.de/fhem/trunk@4068 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
 fhem/www/pgm2/brightstyle.css          |  1 +
 fhem/www/pgm2/console.js               | 11 ++++++-----
 fhem/www/pgm2/darkstyle.css            |  1 +
 fhem/www/pgm2/ios7smallscreenstyle.css |  1 +
 fhem/www/pgm2/ios7style.css            |  2 +-
 fhem/www/pgm2/smallscreenstyle.css     |  1 +
 fhem/www/pgm2/style.css                |  1 +
 fhem/www/pgm2/touchpadstyle.css        |  1 +
 8 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/fhem/www/pgm2/brightstyle.css b/fhem/www/pgm2/brightstyle.css
index 4c16c9b8a..430f5efd0 100644
--- a/fhem/www/pgm2/brightstyle.css
+++ b/fhem/www/pgm2/brightstyle.css
@@ -5,6 +5,7 @@ a img { border:medium none; }
 
 div#logo    { position: fixed; z-index:12000; top:3px; left:5px; float:left; width:24px;height:24px; background:url("../images/default/fhemicon_bright.png") no-repeat;}
 #menu    { position: relative; top: 60px; float:left; width: 25%; padding: 0px 20px 120px;}
+#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
 #hdr     { position: fixed; z-index: 1000; float: left; clear: both; height:32px; width: 100%; -webkit-box-sizing: border-box;  moz-box-sizing: border-box; box-sizing: border-box; background:black; background-image: linear-gradient(#333333,#222222); }
 #content { width:70%; float:right; margin-top:60px; }
 #connect_err { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }
diff --git a/fhem/www/pgm2/console.js b/fhem/www/pgm2/console.js
index cd5f3b828..2799df51a 100644
--- a/fhem/www/pgm2/console.js
+++ b/fhem/www/pgm2/console.js
@@ -20,11 +20,12 @@ consUpdate()
   if(el) {
     el.innerHTML="Events:<br>"+consConn.responseText;
     // Scroll to bottom. FF is different from Safari/Chrome
-    var p = el.parentElement; // content div
-    if(isFF)
-      p.parentElement.parentElement.scrollTop = p.scrollHeight; // html tag
-    else
-      p.parentElement.scrollTop = p.scrollHeight; // body tag
+    el.scrollTop = el.scrollHeight;    
+    //var p = el.parentElement; // content div
+    //if(isFF)
+    //  p.parentElement.parentElement.scrollTop = p.scrollHeight; // html tag
+    //else
+    //  p.parentElement.scrollTop = p.scrollHeight; // body tag
   }
 }
 
diff --git a/fhem/www/pgm2/darkstyle.css b/fhem/www/pgm2/darkstyle.css
index 51df986c5..e5c8d9bcf 100644
--- a/fhem/www/pgm2/darkstyle.css
+++ b/fhem/www/pgm2/darkstyle.css
@@ -2,6 +2,7 @@
 body     { background-color: #444444; background-image:url(../images/default/fhemicon_dark.png); background-repeat:no-repeat; color: #CCCCCC; font-family:Arial, Helvetica, sans-serif; font-size:13px;}
 #logo    { position:absolute; top:10px; left:20px; width:140px; visibility:hidden; }
 #menu    { position:absolute; top:170px;left:20px; width:140px; }
+#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
 #hdr     { position:absolute; top:10px; left:180px; }
 #content { position:absolute; top:50px; left:180px; bottom:20px; right:10px; }
 #connect_err { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }
diff --git a/fhem/www/pgm2/ios7smallscreenstyle.css b/fhem/www/pgm2/ios7smallscreenstyle.css
index 0da8f7fd9..3d0184db7 100644
--- a/fhem/www/pgm2/ios7smallscreenstyle.css
+++ b/fhem/www/pgm2/ios7smallscreenstyle.css
@@ -10,6 +10,7 @@ select   { font-family:Helvetica; font-weight:300; font-size:16px;}
 #logo    { position:absolute; top: 2px; left: 2px; 
            width:64px;  height:67px; background-image:url(../images/default/fhemicon_smallscreen.png); }
 #menu    { position:absolute; top: 2px; left:65px; }
+#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
 #hdr     { position:absolute; top:40px; left:65px; }
 #content { position:absolute; top:85px; left: 0px; right: 0px;}
 #connect_err { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:0px; z-index: 10; }
diff --git a/fhem/www/pgm2/ios7style.css b/fhem/www/pgm2/ios7style.css
index 9566dc003..619e85967 100644
--- a/fhem/www/pgm2/ios7style.css
+++ b/fhem/www/pgm2/ios7style.css
@@ -14,7 +14,7 @@ select   { font-family:Helvetica; font-weight:300; font-size:16px; }
 
 #menu    { margin: 20px 0 20px 12px; width:200px; left: 20px; }
 #menu a { color: #151515; }
-
+#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
 #hdr     { position:absolute; top:20px; left:250px; }
 
 #content { position:absolute; top:50px; left:250px; bottom:20px; right:10px; }
diff --git a/fhem/www/pgm2/smallscreenstyle.css b/fhem/www/pgm2/smallscreenstyle.css
index 38d43e922..520fb7f02 100644
--- a/fhem/www/pgm2/smallscreenstyle.css
+++ b/fhem/www/pgm2/smallscreenstyle.css
@@ -7,6 +7,7 @@ select   { font-family:Arial, sans-serif; font-size:16px;}
 #logo    { position:absolute; top: 2px; left: 2px; 
            width:64px;  height:67px; background-image:url(../images/default/fhemicon_smallscreen.png); }
 #menu    { position:absolute; top: 2px; left:65px; }
+#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
 #hdr     { position:absolute; top:40px; left:65px; }
 #content { position:absolute; top:85px; left: 0px; right: 0px;}
 #connect_err { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:0px; z-index: 10; }
diff --git a/fhem/www/pgm2/style.css b/fhem/www/pgm2/style.css
index 3f46cfdb3..853523de3 100644
--- a/fhem/www/pgm2/style.css
+++ b/fhem/www/pgm2/style.css
@@ -9,6 +9,7 @@ select   { font-family:Arial, sans-serif; font-size:16px; }
 #menuScrollArea { width: 175px; left:0px; top:0px; height:100%; 
                   position:fixed; overflow-x:hidden; overflow-y:auto; } 
 
+#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
 #hdr     { position:absolute; top:10px; left:180px; }
 #content { position:absolute; top:50px; left:180px; bottom:20px; right:10px; }
 
diff --git a/fhem/www/pgm2/touchpadstyle.css b/fhem/www/pgm2/touchpadstyle.css
index 7da316361..a41bd03a8 100644
--- a/fhem/www/pgm2/touchpadstyle.css
+++ b/fhem/www/pgm2/touchpadstyle.css
@@ -8,6 +8,7 @@ select   { font-family:Arial, sans-serif; font-size:18px}
             width:120px;  height:132px; background-image:url(../icons/fhemicon.png); }
 #menu    { position:absolute; top:152px;left:10px; width:140px; }
 #hdr     { position:absolute; top:10px; left:160px; }
+#console { width:100%; height:100%; position:absolute; overflow-y:auto;}
 #content { position:absolute; top:50px; left:160px; bottom:20px; right:10px; }
 #connect_err { background-color: #000000; color: #FFFFFF; position:absolute; top:0px; left:40px; z-index: 10; }