From 4dfe91b246aceb6260733cd52b29b0afd9c73870 Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Fri, 9 Nov 2007 00:41:34 +0000 Subject: [PATCH] slight hint display improvment on illegal hint number --- content/hints.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/content/hints.js b/content/hints.js index 4f18a981..df1d3557 100644 --- a/content/hints.js +++ b/content/hints.js @@ -236,14 +236,16 @@ vimperator.Hints = function() //{{{ return true; } - // no safety checks are done, be careful with this function // TODO: make it aware of imgspans function showActiveHint(newID, oldID) { var oldElem = valid_hints[oldID - 1]; + if (oldElem) + oldElem.style.backgroundColor = "yellow"; + var newElem = valid_hints[newID - 1]; - oldElem.style.backgroundColor = "yellow"; - newElem.style.backgroundColor = "#88FF00"; + if (newElem) + newElem.style.backgroundColor = "#88FF00"; } function showHints(win, start_idx)