From fd631194d5a21933d0dcddcb1aee43f7fd8ab4c0 Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Thu, 31 Jan 2008 12:16:00 +0000 Subject: [PATCH] Fixed vimperator for newer firefoxes due to changed ids --- content/options.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/content/options.js b/content/options.js index 82ea8b6f..9858c6cb 100644 --- a/content/options.js +++ b/content/options.js @@ -210,12 +210,25 @@ vimperator.Options = function () //{{{ } } + // show/hide the menubar, toolbar and bookmarks toolbar function setGuiOptions(value) { - // hide the menubar, toolbar and bookmarks toolbar - document.getElementById("toolbar-menubar").collapsed = !/m/.test(value); - document.getElementById("nav-bar"). collapsed = !/T/.test(value); - document.getElementById("PersonalToolbar").collapsed = !/b/.test(value); + // FIXME: when we release a vimperator with a Firefox3 requirement (no beta), remove the old ids + try + { + document.getElementById("toolbar-menubar").collapsed = !/m/.test(value); + + // these the new ids for Firefox > 20080130 + document.getElementById("navigation-toolbar").collapsed = !/T/.test(value); + document.getElementById("personal-toolbar"). collapsed = !/b/.test(value); + } + catch (e) + { + // these two ids are for Firefox <= 20080130 + document.getElementById("nav-bar"). collapsed = !/T/.test(value); + document.getElementById("PersonalToolbar").collapsed = !/b/.test(value); + // vimperator.log("setGuiOptions raised an exception"); + } guioptionsDone = true; }