mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: scratchpad: handle duplicate click event
This commit is contained in:
1 parent
f030c32813
commit
e964eec099
3 files changed
+11
-3
No files matched your search
@@ -26,7 +26,7 @@ export default connect((state: any) => ({
|
||||
});
|
||||
},
|
||||
}))(class MonacoEditor extends React.PureComponent<ScratchpadOptions> {
|
||||
disposable = [];
|
||||
disposable: monaco.IDisposable[] = [];
|
||||
__prevent_trigger_change_event = false;
|
||||
model: monaco.editor.ITextModel;
|
||||
editor: monaco.editor.IStandaloneCodeEditor;
|
||||
@@ -78,7 +78,7 @@ export default connect((state: any) => ({
|
||||
[
|
||||
{
|
||||
range: model.getFullModelRange(),
|
||||
text: value,
|
||||
text: value!,
|
||||
},
|
||||
],
|
||||
() => null,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.41.15",
|
||||
"version": "4.41.16",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "index.ts",
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user