- From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 09 Aug 2010 08:21:46 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/markup/js In directory hutz:/tmp/cvs-serv26588/js Modified Files: jump-indexes.js Log Message: minor build/style diddling Index: jump-indexes.js =================================================================== RCS file: /sources/public/html5/markup/js/jump-indexes.js,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- jump-indexes.js 6 Aug 2010 23:33:27 -0000 1.9 +++ jump-indexes.js 9 Aug 2010 08:21:44 -0000 1.10 @@ -22,7 +22,6 @@ ["global-attributes","index","toc","toggle"] ] - function showjumpIndexA(event) { var node = event.target; if (jumpIndexA) { @@ -41,9 +40,8 @@ var itemName = items[j]; if (document.body.className.indexOf("chunk") != -1) { if (itemName == 'toc') { - a.setAttribute("href", "Overview.html#unexpanded-toc"); - } - if (itemName == 'toggle') { + a.setAttribute("href", "Overview.html#toc"); + } else if (itemName == 'toggle') { itemName = ""; if (document.documentElement.id) { itemName = "#" + document.documentElement.id; @@ -58,14 +56,20 @@ } } else { if (itemName == 'toc') { - a.setAttribute("href", "#unexpanded-toc"); + a.setAttribute("href", "#toc"); } else if (itemName == 'toggle') { itemName = "Overview.html"; if (window.location.hash) { var fragID = window.location.hash.substring(1,window.location.hash.length); - var elementName = document.evaluate("//*[@id = '" + fragID +"']/ancestor-or-self::div[contains(@class,'section')][count(ancestor::div[contains(@class,'section')])=0 and not(@id='elements')]|//*[@id = '" + fragID + "']/ancestor-or-self::div[contains(@class,'section')][child::h2[@class='element-head']]", - document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.id; - itemName = elementName + ".html" + window.location.hash; + if (fragID == "elements") { + itemName = "elements.html"; + } else { + var pageNode = document.evaluate("//*[@id = '" + fragID +"']/ancestor-or-self::div[contains(@class,'section')][count(ancestor::div[contains(@class,'section')])=0 and not(@id='elements')]|//*[@id = '" + fragID + "']/ancestor-or-self::div[contains(@class,'section')][child::h2[@class='element-head']]", + document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; + if (pageNode) { + itemName = pageNode.id + ".html" + window.location.hash; + } + } } a.setAttribute("href", itemName); itemName = "multi";
Received on Monday, 9 August 2010 08:21:47 UTC