ui: scratchpad: handle duplicate click event

This commit is contained in:
undefined committed 2022-10-16 21:51:48 +08:00
1 parent f030c32813
commit e964eec099
3 files changed
+11 -3

No files matched your search

@@ -163,18 +163,26 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor
$('.loader-container').hide();
}
let progress = false;
async function enterScratchpadMode() {
if (progress) return;
progress = true;
await extender.extend();
await loadReact();
renderReact();
await scratchpadFadeIn();
progress = false;
}
async function leaveScratchpadMode() {
if (progress) return;
progress = true;
await scratchpadFadeOut();
$('.problem-content-container').append($('.problem-content'));
await extender.collapse();
unmountReact();
progress = false;
}
async function loadObjective() {