From 42a2974e5c0ce173f492c248f74393c729eb2bfc Mon Sep 17 00:00:00 2001 From: wingedfox Date: Tue, 15 May 2007 06:58:00 +0200 Subject: TOC toggle usability fix Changes: 1. click event handler moved to the toc__header, because plus and minus signs are too small and not usable because of this 2. minus sign replaced with the bigger one, see http://debugger.ru/temp/cross-plus-9x9.html testcases 3. added the pointer cursor to the toc header darcs-hash:20070515045800-00f02-ed34ebd337c66e3bac731f300f2ce385f64f5e21.gz --- lib/scripts/script.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/scripts/script.js b/lib/scripts/script.js index f03bc4b75..21a3ae8f7 100644 --- a/lib/scripts/script.js +++ b/lib/scripts/script.js @@ -245,12 +245,16 @@ function addTocToggle() { var obj = document.createElement('span'); obj.id = 'toc__toggle'; - obj.innerHTML = '-'; + obj.innerHTML = ''; obj.className = 'toc_close'; - obj.onclick = toggleToc; obj.style.cursor = 'pointer'; prependChild(header,obj); + obj.parentNode.onclick = toggleToc; + try { + obj.parentNode.style.cursor = 'pointer'; + obj.parentNode.style.cursor = 'hand'; + }catch(e){} } /** @@ -261,7 +265,7 @@ function toggleToc() { var obj = $('toc__toggle'); if(toc.style.display == 'none') { toc.style.display = ''; - obj.innerHTML = '-'; + obj.innerHTML = ''; obj.className = 'toc_close'; } else { toc.style.display = 'none'; -- cgit v1.2.3