remember if media controls were open or not

This commit is contained in:
ed 2021-11-24 21:49:41 +01:00
parent 9a8dbbbcf8
commit 4acaf24d65
2 changed files with 14 additions and 14 deletions

View file

@ -295,6 +295,8 @@ html.light #ggrid>a.sel {
width: 100%; width: 100%;
z-index: 3; z-index: 3;
touch-action: none; touch-action: none;
}
#widget.anim {
transition: bottom 0.15s; transition: bottom 0.15s;
} }
#widget.open { #widget.open {

View file

@ -693,24 +693,19 @@ var widget = (function () {
touchmode = false, touchmode = false,
was_paused = true; was_paused = true;
r.is_open = false;
r.open = function () { r.open = function () {
if (r.is_open) return r.set(true);
return false;
clmod(document.documentElement, 'np_open', 1);
widget.className = 'open';
r.is_open = true;
return true;
}; };
r.close = function () { r.close = function () {
if (!r.is_open) return r.set(false);
};
r.set = function (is_open) {
if (r.is_open == is_open)
return false; return false;
clmod(document.documentElement, 'np_open'); clmod(document.documentElement, 'np_open', is_open);
widget.className = ''; widget.className = is_open ? 'open' : '';
r.is_open = false; bcfg_set('au_open', r.is_open = is_open);
return true; return true;
}; };
r.toggle = function (e) { r.toggle = function (e) {
@ -757,6 +752,10 @@ var widget = (function () {
document.body.removeChild(o); document.body.removeChild(o);
}, 500); }, 500);
}; };
r.set(sread('au_open') == 1);
setTimeout(function () {
clmod(ebi('widget'), 'anim', 1);
}, 10);
return r; return r;
})(); })();
@ -5005,7 +5004,6 @@ function reload_mp() {
mp.au = null; mp.au = null;
} }
mpl.stop(); mpl.stop();
widget.close();
var plays = QSA('tr>td:first-child>a.play'); var plays = QSA('tr>td:first-child>a.play');
for (var a = plays.length - 1; a >= 0; a--) for (var a = plays.length - 1; a >= 0; a--)
plays[a].parentNode.innerHTML = '-'; plays[a].parentNode.innerHTML = '-';