From 1f72a1a2ecc89ba789a0b665a5e39da5febe27d2 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Mon, 23 Jan 2023 23:50:39 +0000 Subject: [PATCH] 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. --- kaios/kaiads-glue.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kaios/kaiads-glue.js b/kaios/kaiads-glue.js index 7d26184..8614e24 100644 --- a/kaios/kaiads-glue.js +++ b/kaios/kaiads-glue.js @@ -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();