From ffd2b09b25c61b285169557b93277e7c1476cd4f Mon Sep 17 00:00:00 2001 From: Choom Date: Tue, 13 Dec 2022 03:13:00 -0300 Subject: Barra superior para móviles Barra superior para móviles Barra superior para móviles --- static/js/weabot.js | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'static/js/weabot.js') diff --git a/static/js/weabot.js b/static/js/weabot.js index 3371437..1bab0f6 100644 --- a/static/js/weabot.js +++ b/static/js/weabot.js @@ -266,7 +266,8 @@ document.addEventListener("DOMContentLoaded", function(e) { weabot = { name: null, email: null, password: null }; } - var a = document.getElementById("main_nav").getElementsByTagName("a"); + var head = document.getElementById("main_nav"); + var a = head.getElementsByTagName("a"); for (var i = 0; i < a.length; i++) { if (a[i].getAttribute("href") == "/" + board + "/") { a[i].className = "cur_brd"; @@ -274,6 +275,45 @@ document.addEventListener("DOMContentLoaded", function(e) { } } + if (document.body.clientWidth < 600) { + var navlink = head.getElementsByTagName("a"); + + var sel = document.createElement("select"); + sel.id = head.id + "_sel"; + sel.addEventListener("change", function(e){ + window.location.href = this.value; + }); + + for (var i=1; i