enable collapsing feedlist for compact theme

This commit is contained in:
Andrew Dolgov 2008-02-20 10:06:09 +01:00
parent 22936abb76
commit 58daed52b6
3 changed files with 21 additions and 7 deletions

View file

@ -345,12 +345,12 @@ function feedlist_init() {
if (getInitParam("theme") == "") { if (getInitParam("theme") == "") {
setTimeout("hide_footer()", 5000); setTimeout("hide_footer()", 5000);
}
if (getInitParam("hide_feedlist") == 1) { if (getInitParam("hide_feedlist") == 1) {
init_hidden_feedlist(); init_hidden_feedlist(getInitParam("theme"));
} else { } else {
init_collapsable_feedlist(); init_collapsable_feedlist(getInitParam("theme"));
}
} }
} catch (e) { } catch (e) {
@ -387,10 +387,12 @@ function hide_footer() {
} }
} }
function init_hidden_feedlist() { function init_hidden_feedlist(theme) {
try { try {
debug("init_hidden_feedlist"); debug("init_hidden_feedlist");
if (theme != "") return;
var fl = document.getElementById("feeds-holder"); var fl = document.getElementById("feeds-holder");
var fh = document.getElementById("headlines-frame"); var fh = document.getElementById("headlines-frame");
var fc = document.getElementById("content-frame"); var fc = document.getElementById("content-frame");
@ -415,10 +417,12 @@ function init_hidden_feedlist() {
} }
} }
function init_collapsable_feedlist() { function init_collapsable_feedlist(theme) {
try { try {
debug("init_collapsable_feedlist"); debug("init_collapsable_feedlist");
if (theme != "" && theme != "compact") return;
var fbtn = document.getElementById("collapse_feeds_btn"); var fbtn = document.getElementById("collapse_feeds_btn");
if (fbtn) Element.show(fbtn); if (fbtn) Element.show(fbtn);

View file

@ -764,12 +764,16 @@ function toggle_feedlist() {
function collapse_feedlist() { function collapse_feedlist() {
try { try {
debug("toggle_feedlist"); debug("toggle_feedlist");
var theme = getInitParam("theme");
if (theme != "" && theme != "compact") return;
var fl = document.getElementById("feeds-holder"); var fl = document.getElementById("feeds-holder");
var fh = document.getElementById("headlines-frame"); var fh = document.getElementById("headlines-frame");
var fc = document.getElementById("content-frame"); var fc = document.getElementById("content-frame");
var ft = document.getElementById("toolbar"); var ft = document.getElementById("toolbar");
var ff = document.getElementById("footer"); var ff = document.getElementById("footer");
var fhdr = document.getElementById("header");
var fbtn = document.getElementById("collapse_feeds_btn"); var fbtn = document.getElementById("collapse_feeds_btn");
if (!Element.visible(fl)) { if (!Element.visible(fl)) {
@ -781,6 +785,8 @@ function collapse_feedlist() {
if (fc) fc.style.left = fl.offsetWidth + "px"; if (fc) fc.style.left = fl.offsetWidth + "px";
if (ff) ff.style.left = (fl.offsetWidth-1) + "px"; if (ff) ff.style.left = (fl.offsetWidth-1) + "px";
if (theme == "compact") fhdr.style.left = (fl.offsetWidth + 10) + "px";
setCookie("ttrss_vf_fclps", "0"); setCookie("ttrss_vf_fclps", "0");
} else { } else {
@ -792,6 +798,8 @@ function collapse_feedlist() {
if (fc) fc.style.left = "0px"; if (fc) fc.style.left = "0px";
if (ff) ff.style.left = "0px"; if (ff) ff.style.left = "0px";
if (theme == "compact") fhdr.style.left = "10px";
setCookie("ttrss_vf_fclps", "1"); setCookie("ttrss_vf_fclps", "1");
} }
} catch (e) { } catch (e) {

View file

@ -166,6 +166,8 @@ window.onload = init;
id="toggle_feeds_btn" id="toggle_feeds_btn"
onclick="toggle_feedlist()" style="display : none"> onclick="toggle_feedlist()" style="display : none">
 
<?php if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?> <?php if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
<?php echo __('Search:') ?> <?php echo __('Search:') ?>