version switch: fix keyboard nav 2 #104747

Open
Tobias Heinke wants to merge 4 commits from Tobias/blender-manual:my into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@
<ul id="versionwrap" role="presentation"> <ul id="versionwrap" role="presentation">
<li role="presentation"> <li role="presentation">
<span id="version-popover" class="version-btn" tabindex="0" role="button" aria-label="versions selector" <span id="version-popover" class="version-btn" tabindex="0" role="button" aria-label="versions selector"
aria-haspopup="true" aria-controls="version-vsnlist" aria-disabled="true"> aria-haspopup="true" aria-controls="version-vsnlist">
{{ release }} {{ release }}
</span> </span>
<div class="version-dialog" aria-hidden="true"> <div class="version-dialog" aria-hidden="true">

View File

@ -58,7 +58,7 @@ init() {
}) })
.catch(() => { .catch(() => {
console.error("Version Switch Error: versions.json could not be loaded."); console.error("Version Switch Error: versions.json could not be loaded.");
this.btn.classList.remove("disabled"); this.btn.classList.add("disabled");
}); });
} else { } else {
resolve(); resolve();
@ -83,7 +83,7 @@ init() {
this.btn.classList.remove("wait"); this.btn.classList.remove("wait");
this.btnOpenHandler(); this.btnOpenHandler();
this.btn.addEventListener("mousedown", function(e){that.btnOpenHandler(); e.preventDefault()}); this.btn.addEventListener("mousedown", function(e){that.btnOpenHandler(); e.preventDefault()});
this.btn.addEventListener("keydown", function(e){ if(that.btnKeyFilter(e)){that.btnOpenHandler();} }); this.btn.addEventListener("keydown", function(e){ if(that.btnKeyFilter(e)){that.btnOpenHandler();e.preventDefault()}});
}); });
} }
warnOld(release, all_versions) { warnOld(release, all_versions) {
@ -153,7 +153,7 @@ getNamed(v) {
const m = title.match(/\d\.\d[\w\d\.]*/)[0]; const m = title.match(/\d\.\d[\w\d\.]*/)[0];
if (parseFloat(m) == v) { if (parseFloat(m) == v) {
v = ix; v = ix;
return false; break;
} }
} }
}; };
@ -246,14 +246,14 @@ keyMove(e) {
e.stopPropagation(); e.stopPropagation();
} }
listPrev(nw) { listPrev(nw) {
if (nw.parentNode.previousElementSibling.length !== 0) { if (nw.parentNode.previousElementSibling) {
return nw.parentNode.previousElementSibling.firstElementChild; return nw.parentNode.previousElementSibling.firstElementChild;
} else { } else {
return this.listLast(); return this.listLast();
} }
} }
listNext(nw) { listNext(nw) {
if (nw.parentNode.nextElementSibling.length !== 0) { if (nw.parentNode.nextElementSibling) {
return nw.parentNode.nextElementSibling.firstElementChild; return nw.parentNode.nextElementSibling.firstElementChild;
} else { } else {
return this.listFirst(); return this.listFirst();