add modal dialog
This commit is contained in:
parent
c72b15aa44
commit
2666069a27
4 changed files with 113 additions and 7 deletions
|
|
@ -131,6 +131,9 @@ function space_init(data) {
|
|||
platform.setColor(platcolor);
|
||||
},
|
||||
'keypress', evt => {
|
||||
if (api.modal.showing) {
|
||||
return;
|
||||
}
|
||||
let { shiftKey, metaKey, ctrlKey, code } = evt;
|
||||
switch (code) {
|
||||
case 'KeyC':
|
||||
|
|
@ -173,6 +176,12 @@ function space_init(data) {
|
|||
'keydown', evt => {
|
||||
let rv = Math.PI / 16;
|
||||
let { shiftKey, metaKey, ctrlKey, code } = evt;
|
||||
if (api.modal.showing) {
|
||||
if (code === 'Escape') {
|
||||
api.modal.hide();
|
||||
}
|
||||
return;
|
||||
}
|
||||
switch (code) {
|
||||
case 'KeyA':
|
||||
if (metaKey || ctrlKey) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue