mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 09:22:31 -06:00
fix ctrl-a fencing in codeblocks
This commit is contained in:
parent
5533b47099
commit
5352f7cda7
|
@ -2511,6 +2511,7 @@ var showfile = (function () {
|
||||||
|
|
||||||
wr.appendChild(el);
|
wr.appendChild(el);
|
||||||
wr.style.display = '';
|
wr.style.display = '';
|
||||||
|
set_tabindex();
|
||||||
|
|
||||||
document.documentElement.scrollTop = 0;
|
document.documentElement.scrollTop = 0;
|
||||||
var hfun = no_push ? hist_replace : hist_push;
|
var hfun = no_push ? hist_replace : hist_push;
|
||||||
|
@ -4736,14 +4737,12 @@ function show_md(md, name, div, url, depth) {
|
||||||
var els = QSA('#epi a');
|
var els = QSA('#epi a');
|
||||||
for (var a = 0, aa = els.length; a < aa; a++) {
|
for (var a = 0, aa = els.length; a < aa; a++) {
|
||||||
var href = els[a].getAttribute('href');
|
var href = els[a].getAttribute('href');
|
||||||
if (!href.startsWith('#'))
|
if (!href.startsWith('#') || href.startsWith('#md-'))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
els[a].setAttribute('href', '#md-' + href.slice(1));
|
els[a].setAttribute('href', '#md-' + href.slice(1));
|
||||||
}
|
}
|
||||||
els = QSA('pre');
|
set_tabindex();
|
||||||
for (var a = 0, aa = els.length; a < aa; a++)
|
|
||||||
els[a].setAttribute('tabindex', '0');
|
|
||||||
}
|
}
|
||||||
catch (ex) {
|
catch (ex) {
|
||||||
toast.warn(10, errmsg + ex);
|
toast.warn(10, errmsg + ex);
|
||||||
|
@ -4751,6 +4750,13 @@ function show_md(md, name, div, url, depth) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function set_tabindex() {
|
||||||
|
var els = QSA('pre');
|
||||||
|
for (var a = 0, aa = els.length; a < aa; a++)
|
||||||
|
els[a].setAttribute('tabindex', '0');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function show_readme(md) {
|
function show_readme(md) {
|
||||||
if (!treectl.ireadme)
|
if (!treectl.ireadme)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue