]> git.wh0rd.org Git - tt-rss.git/commitdiff
make feedlist collapsable
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 20 Feb 2008 05:27:16 +0000 (06:27 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 20 Feb 2008 05:27:16 +0000 (06:27 +0100)
feedlist.js
tt-rss.js
tt-rss.php

index 7a373b718d0225e8775edee1bb02bf1e036586ae..e94cf12af24e29f23f31a8887de36fd81e72d25c 100644 (file)
@@ -348,6 +348,8 @@ function feedlist_init() {
 
                        if (getInitParam("hide_feedlist") == 1) {
                                init_hidden_feedlist();
+                       } else {
+                               init_collapsable_feedlist();
                        }
                }
 
@@ -412,3 +414,17 @@ function init_hidden_feedlist() {
                exception_error("init_hidden_feedlist", e);
        }
 }
+
+function init_collapsable_feedlist() {
+       try {
+               debug("init_collapsable_feedlist");
+
+               var fbtn = document.getElementById("collapse_feeds_btn");
+
+               if (fbtn) Element.show(fbtn);
+
+       } catch (e) {
+               exception_error("init_hidden_feedlist", e);
+       }
+
+}
index cd65fe79964199170c46ee90173240cd379eb3a4..a6f0e2c66fc36a2afcfd06d96ada4623d036c61f 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -760,3 +760,40 @@ function toggle_feedlist() {
                exception_error(e, "toggle_feedlist");
        }
 }
+
+function collapse_feedlist() {
+       try {
+               debug("toggle_feedlist");
+
+               var fl = document.getElementById("feeds-holder");
+               var fh = document.getElementById("headlines-frame");
+               var fc = document.getElementById("content-frame");
+               var ft = document.getElementById("toolbar");
+               var ff = document.getElementById("footer");
+               var fbtn = document.getElementById("collapse_feeds_btn");
+
+               if (!Element.visible(fl)) {
+                       Element.show(fl);
+                       fbtn.value = "<<";
+
+                       fh.style.left = fl.offsetWidth + "px";
+                       ft.style.left = fl.offsetWidth + "px";
+                       if (fc) fc.style.left = fl.offsetWidth + "px";
+                       if (ff) ff.style.left = fl.offsetWidth + "px";
+
+               } else {
+                       Element.hide(fl);
+                       fbtn.value = ">>";
+
+                       fh.style.left = "0px";
+                       ft.style.left = "0px";
+                       if (fc) fc.style.left = "0px";
+                       if (ff) ff.style.left = "0px";
+               }
+       } catch (e) {
+               exception_error(e, "toggle_feedlist");
+       }
+
+
+
+}
index 0cb86c365e5efb4c1c3824393d67626f0f8d498e..6778bf9589cc4d4f94a663057ad351a0f41b6a31 100644 (file)
@@ -158,7 +158,12 @@ window.onload = init;
 
                <form id="main_toolbar_form" onsubmit='return false'>
 
-               <input type="submit" value="<?php echo __("Toggle Feedlist") ?>" id="toggle_feeds_btn"
+               <input type="submit" value="&lt;&lt;" 
+                       id="collapse_feeds_btn" onclick="collapse_feedlist()" 
+                       title="<?php echo __('Collapse feedlist') ?>" style="display : none">
+
+               <input type="submit" value="<?php echo __("Toggle Feedlist") ?>" 
+                       id="toggle_feeds_btn"
                        onclick="toggle_feedlist()" style="display : none">
 
                <?php if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>