navpane default on if 60em viewport

This commit is contained in:
ed 2021-11-06 20:32:43 +01:00
parent b3aaa7bd0f
commit 86a859de17

View file

@ -2859,7 +2859,7 @@ function tree_neigh(n) {
treectl.dir_cb = function () { treectl.dir_cb = function () {
tree_neigh(n); tree_neigh(n);
}; };
treectl.entree(); treectl.entree(null, true);
return; return;
} }
var act = -1; var act = -1;
@ -2890,7 +2890,7 @@ function tree_up() {
var act = QS('#treeul a.hl'); var act = QS('#treeul a.hl');
if (!act) { if (!act) {
treectl.dir_cb = tree_up; treectl.dir_cb = tree_up;
treectl.entree(); treectl.entree(null, true);
return; return;
} }
if (act.previousSibling.textContent == '-') if (act.previousSibling.textContent == '-')
@ -3339,10 +3339,11 @@ var treectl = (function () {
} }
setwrap(r.wtree); setwrap(r.wtree);
r.entree = function (e) { r.entree = function (e, nostore) {
ev(e); ev(e);
entreed = true; entreed = true;
swrite('entreed', 'tree'); if (!nostore)
swrite('entreed', 'tree');
get_tree("", get_evpath(), true); get_tree("", get_evpath(), true);
r.show(); r.show();
@ -3875,9 +3876,11 @@ var treectl = (function () {
ebi('twig').onclick = scaletree; ebi('twig').onclick = scaletree;
ebi('twobytwo').onclick = scaletree; ebi('twobytwo').onclick = scaletree;
var cs = sread('entreed'); var cs = sread('entreed'),
if ((is_touch && cs == 'tree') || (!is_touch && cs != 'na')) vw = window.innerWidth / parseFloat(getComputedStyle(document.body)['font-size']);
r.entree();
if (cs == 'tree' || (cs != 'na' && vw >= 60))
r.entree(null, true);
window.onpopstate = function (e) { window.onpopstate = function (e) {
console.log("h-pop " + e.state); console.log("h-pop " + e.state);