make feedlist collapsable
This commit is contained in:
parent
b16754c3a4
commit
8389b15082
3 changed files with 59 additions and 1 deletions
16
feedlist.js
16
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
37
tt-rss.js
37
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");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -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="<<"
|
||||
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')) { ?>
|
||||
|
|
Loading…
Reference in a new issue