diff --git a/Manual/contents/assets/scripts/main_script.js b/Manual/contents/assets/scripts/main_script.js index 3cc0d3743..85a96f471 100644 --- a/Manual/contents/assets/scripts/main_script.js +++ b/Manual/contents/assets/scripts/main_script.js @@ -2597,7 +2597,7 @@ var listStyle = `float: right; padding: 8px; border-radius: 4px;` -var myParent = window.parent.document.body.getElementsByClassName("header")[0]; +var myParent = window.parent.document.getElementsByClassName("header")[0]; // No context view style and parent elm if (myParent == undefined) { @@ -2609,25 +2609,25 @@ if (myParent == undefined) { `; } +//Create array of options to be added +var array = [ + { name: "English", code: "en" }, + { name: "Français", code: "fr" }, + { name: "Español", code: "es" }, + { name: "Deutsch", code: "de" }, + { name: "Русский", code: "ru" }, + { name: "Italiano", code: "it" }, + { name: "Polski", code: "pl" }, + { name: "Português Brasileiro", code: "br" }, + { name: "한국인", code: "ko" }, + { name: "中国人", code: "zh" }, + { name: "日本語", code: "ja" } +]; + // Make sure it doesn't already exist var existingSelectList = window.parent.document.getElementById("mySelect"); if (existingSelectList == undefined) { - //Create array of options to be added - var array = [ - { name: "English", code: "en" }, - { name: "Français", code: "fr" }, - { name: "Español", code: "es" }, - { name: "Deutsch", code: "de" }, - { name: "Русский", code: "ru" }, - { name: "Italiano", code: "it" }, - { name: "Polski", code: "pl" }, - { name: "Português Brasileiro", code: "br" }, - { name: "한국인", code: "ko" }, - { name: "中国人", code: "zh" }, - { name: "日本語", code: "ja" } - ]; - //Create and append select list var selectList = document.createElement("select"); selectList.id = "mySelect"; @@ -2652,18 +2652,19 @@ if (existingSelectList == undefined) { for( var i=0; i= 3) { folders[2] = entry.code; } // end if - window.parent.location.pathname = `${folders.join('/')}`; + var newpath = `${folders.join('/')}`; + window.parent.location.pathname = newpath; } });