diff --git a/feedlist.js b/feedlist.js index 7a373b718..e94cf12af 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 cd65fe799..a6f0e2c66 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 0cb86c365..6778bf958 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -158,7 +158,12 @@ window.onload = init;