mirror of
https://github.com/9001/copyparty.git
synced 2026-06-18 20:22:27 -06:00
fix fast tree toggles
This commit is contained in:
parent
3b8399fa3b
commit
aff5004a41
|
|
@ -7748,11 +7748,12 @@ var treectl = (function () {
|
|||
clmod(ebi('wfp'), 'shifted', false);
|
||||
window.addEventListener('scroll', onscroll);
|
||||
window.addEventListener('resize', onresize);
|
||||
// accounts for animation delay
|
||||
|
||||
// makes animation work by waiting for next frame
|
||||
setTimeout(function () {
|
||||
onresize();
|
||||
aligngriditems();
|
||||
}, 150);
|
||||
}, 10);
|
||||
};
|
||||
|
||||
r.detree = function (e, nw) {
|
||||
|
|
@ -7780,9 +7781,6 @@ var treectl = (function () {
|
|||
r.hide = function () {
|
||||
r.hidden = true;
|
||||
ebi('tree').style.width = ebi('tree_footer').style.width = '0';
|
||||
setTimeout(function () {
|
||||
ebi('tree').style.display = 'none'
|
||||
}, 150);
|
||||
ebi('tree_footer').style.display = 'none';
|
||||
ebi('widget').style.marginLeft = '0';
|
||||
ebi('wrap').style.marginLeft = '';
|
||||
|
|
@ -7790,6 +7788,11 @@ var treectl = (function () {
|
|||
window.removeEventListener('resize', onresize);
|
||||
window.removeEventListener('scroll', onscroll);
|
||||
aligngriditems();
|
||||
|
||||
// wait for animation to finish (.15s), then set display to none if width still 0
|
||||
setTimeout(function () {
|
||||
onresize();
|
||||
}, 150);
|
||||
};
|
||||
|
||||
function unmenter() {
|
||||
|
|
@ -7876,8 +7879,11 @@ var treectl = (function () {
|
|||
timer.add(onscroll2, true);
|
||||
|
||||
function onresize(e) {
|
||||
if (!entreed || r.hidden)
|
||||
if (!entreed || r.hidden){
|
||||
if(ebi('tree').style.width <= 0)
|
||||
ebi('tree').style.display = 'none';
|
||||
return;
|
||||
}
|
||||
|
||||
var q = '#tree',
|
||||
nq = -3;
|
||||
|
|
|
|||
Loading…
Reference in a new issue