dodge osx-safari bugs

This commit is contained in:
ed 2020-05-14 00:28:10 +02:00
parent 27cb1d4fc7
commit e050e69a43
2 changed files with 16 additions and 2 deletions

View file

@ -425,6 +425,16 @@ blink {
html.dark #mw { html.dark #mw {
scrollbar-color: #b80 #282828; scrollbar-color: #b80 #282828;
} }
html.dark #toc::-webkit-scrollbar-track {
background: #282828;
}
html.dark #toc::-webkit-scrollbar {
background: #282828;
width: .8em;
}
html.dark #toc::-webkit-scrollbar-thumb {
background: #eb0;
}
html.dark #mn.undocked { html.dark #mn.undocked {
box-shadow: 0 0 .5em #555; box-shadow: 0 0 .5em #555;
border: none; border: none;

View file

@ -23,6 +23,7 @@ var map_src = [];
var map_pre = []; var map_pre = [];
function genmap(dom) { function genmap(dom) {
var ret = []; var ret = [];
var last_y = -1;
var parent_y = 0; var parent_y = 0;
var parent_n = null; var parent_n = null;
var nodes = dom.querySelectorAll('*[data-ln]'); var nodes = dom.querySelectorAll('*[data-ln]');
@ -48,11 +49,14 @@ function genmap(dom) {
while (ln > ret.length) while (ln > ret.length)
ret.push(null); ret.push(null);
if (parent_y == 0 && n.offsetTop == 0) var y = parent_y + n.offsetTop;
if (y <= last_y)
//console.log('awawa'); //console.log('awawa');
continue; continue;
ret.push(parent_y + n.offsetTop); //console.log('%d %d (%d+%d)', a, y, parent_y, n.offsetTop);
ret.push(y);
last_y = y;
} }
return ret; return ret;
} }