]> git.wh0rd.org Git - tt-rss.git/commitdiff
enable collapsing feedlist for compact theme
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 20 Feb 2008 09:06:09 +0000 (10:06 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 20 Feb 2008 09:06:09 +0000 (10:06 +0100)
feedlist.js
tt-rss.js
tt-rss.php

index 486409ae913bfb3c52ca0102cdc478da9aead295..2e6e9e891c7c97830ba93b780a28c4d2d2090221 100644 (file)
@@ -345,12 +345,12 @@ function feedlist_init() {
 
                if (getInitParam("theme") == "") {
                        setTimeout("hide_footer()", 5000);
+               }
 
-                       if (getInitParam("hide_feedlist") == 1) {
-                               init_hidden_feedlist();
-                       } else {
-                               init_collapsable_feedlist();
-                       }
+               if (getInitParam("hide_feedlist") == 1) {
+                       init_hidden_feedlist(getInitParam("theme"));
+               } else {
+                       init_collapsable_feedlist(getInitParam("theme"));
                }
 
        } catch (e) {
@@ -387,10 +387,12 @@ function hide_footer() {
        }
 }
 
-function init_hidden_feedlist() {
+function init_hidden_feedlist(theme) {
        try {
                debug("init_hidden_feedlist");
 
+               if (theme != "") return;
+
                var fl = document.getElementById("feeds-holder");
                var fh = document.getElementById("headlines-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 {
                debug("init_collapsable_feedlist");
 
+               if (theme != "" && theme != "compact") return;
+
                var fbtn = document.getElementById("collapse_feeds_btn");
 
                if (fbtn) Element.show(fbtn);
index 7951c52f382f54bb5468146fdac1f89fbcc577cc..2dea192179474912103e8fc91640db5b4f246e57 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -764,12 +764,16 @@ function toggle_feedlist() {
 function collapse_feedlist() {
        try {
                debug("toggle_feedlist");
+               
+               var theme = getInitParam("theme");
+               if (theme != "" && theme != "compact") return;
 
                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 fhdr = document.getElementById("header");
                var fbtn = document.getElementById("collapse_feeds_btn");
 
                if (!Element.visible(fl)) {
@@ -781,6 +785,8 @@ function collapse_feedlist() {
                        if (fc) fc.style.left = fl.offsetWidth + "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");
 
                } else {
@@ -792,6 +798,8 @@ function collapse_feedlist() {
                        if (fc) fc.style.left = "0px";
                        if (ff) ff.style.left = "0px";
 
+                       if (theme == "compact") fhdr.style.left = "10px";
+
                        setCookie("ttrss_vf_fclps", "1");
                }
        } catch (e) {
index 6778bf9589cc4d4f94a663057ad351a0f41b6a31..aad306f0ab47b609bb148b03b6f7c523acff8963 100644 (file)
@@ -166,6 +166,8 @@ window.onload = init;
                        id="toggle_feeds_btn"
                        onclick="toggle_feedlist()" style="display : none">
 
+               &nbsp;
+
                <?php if (get_pref($link, 'ENABLE_SEARCH_TOOLBAR')) { ?>
 
                <?php echo __('Search:') ?>