From 1b0809ae450c1fb6b528c37c2c9e48e766ef7cc2 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 20 Dec 2005 12:14:24 +0100 Subject: [PATCH] fix forced selection of dropboxes (functions.js:dropboxSelect()) --- feedlist.js | 10 +++++++--- functions.js | 9 +++++++++ tt-rss.js | 12 ++++++++---- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/feedlist.js b/feedlist.js index 8c9ca61d..c58dff61 100644 --- a/feedlist.js +++ b/feedlist.js @@ -192,7 +192,11 @@ function toggleCollapseCat(cat) { } function init() { - hideOrShowFeeds(document, getCookie("ttrss_vf_hreadf") == 1); - document.onkeydown = hotkey_handler; - parent.setTimeout("timeout()", 1000); + try { + hideOrShowFeeds(document, getCookie("ttrss_vf_hreadf") == 1); + document.onkeydown = hotkey_handler; + parent.setTimeout("timeout()", 1000); + } catch (e) { + exception_error("feedlist/init()", e); + } } diff --git a/functions.js b/functions.js index ca51b1ac..2764a5bb 100644 --- a/functions.js +++ b/functions.js @@ -744,3 +744,12 @@ function showBlockElement(id) { function hideParentElement(e) { e.parentNode.style.display = "none"; } + +function dropboxSelect(e, v) { + for (i = 0; i < e.length; i++) { + if (e[i].value == v) { + e.selectedIndex = i; + break; + } + } +} diff --git a/tt-rss.js b/tt-rss.js index 45da0339..10aa2d2b 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -365,16 +365,20 @@ function init_second_stage() { document.onkeydown = hotkey_handler; var content = document.getElementById("content"); + + dropboxSelect(viewbox, getCookie("ttrss_vf_vmode")); - if (getCookie("ttrss_vf_vmode")) { - var viewbox = document.getElementById("viewbox"); - viewbox.value = getCookie("ttrss_vf_vmode"); +/* if (getCookie("ttrss_vf_vmode")) { + var viewbox = document.getElementById("viewbox"); + if (getCookie("ttrss_vf_vmode")) { + viewbox.value = getCookie("ttrss_vf_vmode"); + } } if (getCookie("ttrss_vf_limit")) { var limitbox = document.getElementById("limitbox"); limitbox.value = getCookie("ttrss_vf_limit"); - } + } */ // if (getCookie("ttrss_vf_actfeed")) { // viewfeed(getCookie("ttrss_vf_actfeed"), 0, ''); -- 2.39.5