From 6a8fb8fe281140384f562b2022a7c99a9903a46d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20St=C3=B6r?= Date: Mon, 28 Dec 2015 21:57:38 +0100 Subject: [PATCH] Fix fly-out menu content and add temporary debugger --- docs/js/extra.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/js/extra.js b/docs/js/extra.js index 9eb3b82d..c0ea4f44 100644 --- a/docs/js/extra.js +++ b/docs/js/extra.js @@ -8,6 +8,11 @@ var nodemcu = nodemcu || {}; $(document).ready(function () { hideNavigationForAllButSelectedLanguage(); addLanguageSelectorToRtdFlyOutMenu(); + document.addEventListener("DOMSubtreeModified", function(e) { + // Notify of change! + debugger; + console.warn("change!", e); + }, false); }); function hideNavigationForAllButSelectedLanguage() { @@ -55,10 +60,11 @@ var nodemcu = nodemcu || {}; } function createLanguageLinkFor(languageCode, isCurrentlySelected) { var strong; + // split[0] is an '' because the path starts with the separator var pathSegments = window.location.pathname.split('/'); var dd = document.createElement("dd"); - var href = document.createElement("href"); - href.setAttribute('a', '/' + pathSegments[0] + '/' + pathSegments[1] + '/' + languageCode); + var href = document.createElement("a"); + href.setAttribute('href', '/' + pathSegments[1] + '/' + pathSegments[2] + '/' + languageCode); href.appendChild(document.createTextNode(languageCode)); dd.appendChild(href); if (isCurrentlySelected) {