Move KaiAds menu option

It's a bit of a nuisance at the moment if you're trying to get to the
documentation by pressing the up arrow, so I've moved it above the
documentation links, which is where I keep expecting to find it.  I
probably want to do some larger-scale menu re-organisation on KaiOS,
though.
This commit is contained in:
Ben Harris
2023-01-23 23:50:39 +00:00
parent 31badae3c1
commit 1f72a1a2ec

View File

@ -20,7 +20,9 @@
advertbutton.disabled = true;
var advertli = document.createElement("li");
advertli.appendChild(advertbutton);
menuform.querySelector("ul").appendChild(advertli);
var topmenu = menuform.querySelector("ul");
var before = topmenu.querySelector(":scope > li:nth-last-child(2)");
topmenu.insertBefore(advertli, before);
// Now work out whether we're installed from the Store (and hence
// want real adverts) or not (and hence want test ones).
var selfrequest = navigator.mozApps.getSelf();