aboutsummaryrefslogtreecommitdiff
path: root/static/js/weabot.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/js/weabot.js')
-rw-r--r--static/js/weabot.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/static/js/weabot.js b/static/js/weabot.js
index 3f8aac7..45b7063 100644
--- a/static/js/weabot.js
+++ b/static/js/weabot.js
@@ -343,6 +343,23 @@ document.addEventListener("DOMContentLoaded", function(e) {
if (a[i].getAttribute("href") == "/"+board+"/") {a[i].className = "cur_brd"; break;}
}
+ if (screen.width<720) {
+ var head=document.getElementById("main_nav");
+ var b=head.getElementsByTagName("a");
+ var s=document.createElement("select");
+ for(var i=0;i<b.length;i++) {
+ var o = document.createElement("option");
+ o.value = b[i].href;
+ o.textContent = b[i].textContent;
+ if(b[i].className=="cur_brd") o.defaultSelected = true;
+ s.appendChild(o);
+ }
+ s.addEventListener("change", function(e){ window.location.href=this.value; });
+ head.removeChild(head.childNodes[0]);
+ head.className = "mob fix";
+ head.insertBefore(s, head.childNodes[0]);
+ }
+
if(localStorage.hasOwnProperty("hiddenthreads")) {
hiddenthreads = localStorage.getItem("hiddenthreads").split("!");
if (document.getElementById("catalog")) {