pull/88/head
Zoe 6 years ago
parent 3fe0040f9e
commit 48c9e2e08a

@ -116,3 +116,11 @@ export async function readClipboardText()
return await navigator["clipboard"].readText(); return await navigator["clipboard"].readText();
return ""; return "";
} }
export function Sleep(time: number)
{
return new Promise(res =>
{
setTimeout(res, time);
})
}

@ -174,6 +174,8 @@ export class GetEntityServices implements EditorService
} }
private Retun(result: PromptEntityResult) private Retun(result: PromptEntityResult)
{ {
if (!this.m_promisResolve)
return;
this.RestState(); this.RestState();
this.m_promisResolve(result); this.m_promisResolve(result);
} }

@ -151,6 +151,8 @@ export class GetKeyWordsServices implements EditorService
} }
_Return(result: PromptResult) _Return(result: PromptResult)
{ {
if (!this.m_PromisResolve)
return;
this.IsReady = false; this.IsReady = false;
this.m_Editor.m_InputState &= ~InputState.GetKeyWord; this.m_Editor.m_InputState &= ~InputState.GetKeyWord;
this.removeCalls.forEach(f => f()); this.removeCalls.forEach(f => f());

@ -10,6 +10,7 @@ import { Editor } from '../../../Editor/Editor';
import { PointPick } from '../../../Editor/PointPick'; import { PointPick } from '../../../Editor/PointPick';
import { LightModal } from './LightModal'; import { LightModal } from './LightModal';
import './Modal.less'; import './Modal.less';
import { Sleep } from '../../../Common/Utils';
export enum ModalPosition export enum ModalPosition
{ {
@ -159,7 +160,11 @@ export class ModalManage
if (app.m_Editor.m_CommandStore.isCmdIng) if (app.m_Editor.m_CommandStore.isCmdIng)
{ {
app.m_Editor.Canel(); app.m_Editor.Canel();
await Sleep(10);
} }
if (app.m_Editor.m_CommandStore.isCmdIng)
return;
app.m_Editor.m_CommandStore.isCmdIng = true; app.m_Editor.m_CommandStore.isCmdIng = true;
app.m_Database.hm.StartCmd("draw"); app.m_Database.hm.StartCmd("draw");
await this.Callback(); await this.Callback();

Loading…
Cancel
Save