Storyboard: a refresh waits while a clip is playing or the author is typing
This commit is contained in:
parent
e359067b14
commit
7a0d3ab1b1
1 changed files with 11 additions and 0 deletions
11
trailer.html
11
trailer.html
|
|
@ -322,7 +322,18 @@
|
||||||
if (!busy && timer) { clearInterval(timer); timer = null; }
|
if (!busy && timer) { clearInterval(timer); timer = null; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A refresh redraws the whole storyboard. While the author is watching a
|
||||||
|
// clip, or typing a note, or has the background box open, that redraw
|
||||||
|
// would stop the player and throw the typing away - so it waits.
|
||||||
|
function authorBusy() {
|
||||||
|
var vids = document.querySelectorAll("#pane video");
|
||||||
|
for (var i = 0; i < vids.length; i++) if (!vids[i].paused && !vids[i].ended) return true;
|
||||||
|
var a = document.activeElement;
|
||||||
|
if (a && a.closest && a.closest("#pane") && /^(TEXTAREA|INPUT)$/.test(a.tagName)) return true;
|
||||||
|
return !!(BGEDIT || EDITING);
|
||||||
|
}
|
||||||
async function refresh() {
|
async function refresh() {
|
||||||
|
if (authorBusy()) { tick(); return; }
|
||||||
var r = await api("run_status", { run_id: runId });
|
var r = await api("run_status", { run_id: runId });
|
||||||
if (!r.ok) return;
|
if (!r.ok) return;
|
||||||
RUN = r.run; DRAFTS = r.drafts || [];
|
RUN = r.run; DRAFTS = r.drafts || [];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue