Fix fly-out menu content and add temporary debugger
This commit is contained in:
parent
046ad545ae
commit
6a8fb8fe28
|
@ -8,6 +8,11 @@ var nodemcu = nodemcu || {};
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
hideNavigationForAllButSelectedLanguage();
|
hideNavigationForAllButSelectedLanguage();
|
||||||
addLanguageSelectorToRtdFlyOutMenu();
|
addLanguageSelectorToRtdFlyOutMenu();
|
||||||
|
document.addEventListener("DOMSubtreeModified", function(e) {
|
||||||
|
// Notify of change!
|
||||||
|
debugger;
|
||||||
|
console.warn("change!", e);
|
||||||
|
}, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
function hideNavigationForAllButSelectedLanguage() {
|
function hideNavigationForAllButSelectedLanguage() {
|
||||||
|
@ -55,10 +60,11 @@ var nodemcu = nodemcu || {};
|
||||||
}
|
}
|
||||||
function createLanguageLinkFor(languageCode, isCurrentlySelected) {
|
function createLanguageLinkFor(languageCode, isCurrentlySelected) {
|
||||||
var strong;
|
var strong;
|
||||||
|
// split[0] is an '' because the path starts with the separator
|
||||||
var pathSegments = window.location.pathname.split('/');
|
var pathSegments = window.location.pathname.split('/');
|
||||||
var dd = document.createElement("dd");
|
var dd = document.createElement("dd");
|
||||||
var href = document.createElement("href");
|
var href = document.createElement("a");
|
||||||
href.setAttribute('a', '/' + pathSegments[0] + '/' + pathSegments[1] + '/' + languageCode);
|
href.setAttribute('href', '/' + pathSegments[1] + '/' + pathSegments[2] + '/' + languageCode);
|
||||||
href.appendChild(document.createTextNode(languageCode));
|
href.appendChild(document.createTextNode(languageCode));
|
||||||
dd.appendChild(href);
|
dd.appendChild(href);
|
||||||
if (isCurrentlySelected) {
|
if (isCurrentlySelected) {
|
||||||
|
|
Loading…
Reference in New Issue