]> git.wh0rd.org - tt-rss.git/commitdiff
only enable bottom actions toolbar in headlines, when headlines list scrolls
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 25 Feb 2006 06:15:05 +0000 (07:15 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 25 Feb 2006 06:15:05 +0000 (07:15 +0100)
backend.php
viewfeed.js

index a58cb85e9a0fb91d35b579281811ee95759c0685..3dda8d0bbe68e6c90a75a7fd7da5c37ef7dda39c 100644 (file)
                        return;
                }
 
-               function print_headline_subtoolbar($link, $feed_site_url, $feed_title) {
+               function print_headline_subtoolbar($link, $feed_site_url, $feed_title, 
+                                               $bottom = false) {
 
-                       print "<table class=\"headlinesSubToolbar\" 
+                       if (!$bottom) {
+                               $class = "headlinesSubToolbar";
+                               $tid = "headlineActionsTop";
+                       } else {
+                               $class = "invisible";
+                               $tid = "headlineActionsBottom";
+                       }
+
+                       print "<table class=\"$class\" id=\"$tid\"
                                width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr>";
 
                        if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) {
                                print "</table>";
                        }
 
-                       print_headline_subtoolbar($link, "javascript:catchupPage()", "Mark page as read");
+                       print_headline_subtoolbar($link, 
+                               "javascript:catchupPage()", "Mark page as read", true);
 
 
                } else {
index 83a34885325e3caa1bd2df16d38f6c137bf6271e..1f0d4d283541a651a43721b21997c1cc858877e7 100644 (file)
@@ -385,4 +385,13 @@ function init() {
        if (arguments.callee.done) return;
        arguments.callee.done = true;           
        document.onkeydown = hotkey_handler;
+
+       var hw = document.getElementById("headlinesList").scrollHeight;
+       var pw = parent.document.getElementById("headlines").scrollHeight;
+
+       if (hw >= pw) {
+               var bt = document.getElementById("headlineActionsBottom");
+               bt.className = "headlinesSubToolbar";
+       }
+       
 }