Clean up Oasis-Mobile-UX theme: cascade order, drop dead JS
- Link the theme after mobile.css on mobile builds (OASIS_MOBILE=1) so it wins by cascade; removed ~420 !important, keeping only the few that override epsylon's inline styles. - Reveal the quick bar without !important: the inline display:none is emitted only on desktop. - Remove unused oasis-mobile-nav.js (it was never linked and would be blocked by CSP script-src 'none' on clearnet). - epsylon's mobile.css and OasisMobile.css left untouched.
This commit is contained in:
parent
8d21216362
commit
230d11ba7a
3 changed files with 436 additions and 468 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -1,36 +0,0 @@
|
|||
(function () {
|
||||
function mark() {
|
||||
var p = (location.pathname || "/").replace(/\/+$/, "") || "/";
|
||||
var links = document.querySelectorAll(".oasis-bottombar a.bb-item");
|
||||
var best = null, bestLen = -1;
|
||||
links.forEach(function (a) {
|
||||
var h = (a.getAttribute("href") || "").replace(/\/+$/, "") || "/";
|
||||
if (h === "/") return;
|
||||
if (p === h || p.indexOf(h + "/") === 0) {
|
||||
if (h.length > bestLen) { best = a; bestLen = h.length; }
|
||||
}
|
||||
});
|
||||
if (best) best.classList.add("current");
|
||||
}
|
||||
|
||||
function onToggle(e) {
|
||||
var t = e.target;
|
||||
if (!t || !t.classList || !t.classList.contains("oasis-nav-toggle")) return;
|
||||
if (!t.checked) return;
|
||||
var group = t.closest(".oasis-nav-group");
|
||||
var scope = group && group.parentElement;
|
||||
if (!scope) return;
|
||||
var others = scope.querySelectorAll(
|
||||
":scope > .oasis-nav-group > .oasis-nav-toggle"
|
||||
);
|
||||
others.forEach(function (o) { if (o !== t) o.checked = false; });
|
||||
}
|
||||
|
||||
function init() {
|
||||
mark();
|
||||
document.addEventListener("change", onToggle);
|
||||
}
|
||||
|
||||
if (document.readyState !== "loading") init();
|
||||
else document.addEventListener("DOMContentLoaded", init);
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue