From 8389b150824a0ec5cc050c9dc2d8ed20f9d948ad Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 20 Feb 2008 06:27:16 +0100 Subject: [PATCH] make feedlist collapsable --- feedlist.js | 16 ++++++++++++++++ tt-rss.js | 37 +++++++++++++++++++++++++++++++++++++ tt-rss.php | 7 ++++++- 3 files changed, 59 insertions(+), 1 deletion(-) diff --git a/feedlist.js b/feedlist.js index 7a373b71..e94cf12a 100644 --- a/feedlist.js +++ b/feedlist.js @@ -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); + } + +} diff --git a/tt-rss.js b/tt-rss.js index cd65fe79..a6f0e2c6 100644 --- 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"); + } + + + +} diff --git a/tt-rss.php b/tt-rss.php index 0cb86c36..6778bf95 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -158,7 +158,12 @@ window.onload = init;
- " id="toggle_feeds_btn" + + + " + id="toggle_feeds_btn" onclick="toggle_feedlist()" style="display : none"> -- 2.39.5