]> git.wh0rd.org - tt-rss.git/commitdiff
auto-resize headlines container to 30% of window height
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 13 Apr 2007 06:59:07 +0000 (07:59 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 13 Apr 2007 06:59:07 +0000 (07:59 +0100)
tt-rss.js
tt-rss.php

index 5f913f86f5837c460553a4b1e7a4ecf5ec55cd8d..4b2f3eceb474f434c6c31b8549c43f3dd7885217 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -376,6 +376,19 @@ function init() {
        }
 }
 
+function resize_headlines() {
+       var h_frame = document.getElementById("headlines-frame");
+       var c_frame = document.getElementById("content-frame");
+
+       debug("resize_headlines");
+
+       if (c_frame && h_frame) {
+               h_frame.style.height = 30 + "%";
+               c_frame.style.top = h_frame.offsetTop + h_frame.offsetHeight + 1 + "px";
+               h_frame.style.height = h_frame.offsetHeight + "px";
+       }
+}
+
 function init_second_stage() {
 
        try {
@@ -384,7 +397,9 @@ function init_second_stage() {
 
                delCookie("ttrss_vf_test");
        
-               document.onkeydown = hotkey_handler;
+               document.onresize = resize_headlines;
+
+               resize_headlines();
 
                var toolbar = document.forms["main_toolbar_form"];
 
index 420aaf5f5be17d5588c1330b7cf6de2744e63169..c9e2555df9cd6426894e7a8adef97f4991c3fa32 100644 (file)
@@ -68,7 +68,7 @@
        </script>
 </head>
 
-<body>
+<body onresize="resize_headlines()">
 
 <iframe id="backReqBox"></iframe>