File tree Expand file tree Collapse file tree 4 files changed +24
-19
lines changed Expand file tree Collapse file tree 4 files changed +24
-19
lines changed Original file line number Diff line number Diff line change 365
365
}
366
366
})
367
367
368
+ emitter .on (' entity-not-mutate-down' , async (entity : Entity ) => {
369
+ const _id = CONTEXT .entities .indexOf (entity )
370
+
371
+ focus .value = false
372
+ edit .value = false
373
+
374
+ await nextTick
375
+
376
+ if (CONTEXT .entities [_id + 1 ] === props .entity ) {
377
+ onEdit ()
378
+ }
379
+ })
380
+
368
381
emitter .on (' project-save' , () => {
369
382
emitter .emit (' entity-close' , { all: true })
370
383
})
371
384
372
385
emitter .on (' entity-force-close' , () => {
373
386
onUpdateContent ()
374
387
})
388
+
389
+ emitter .on (' entity-update-area' , () => {
390
+ if (document .activeElement === input .value ) {
391
+ console .log (' kekwww' )
392
+ onChangeArea ()
393
+ }
394
+ })
375
395
})
376
396
377
397
const onUpdateContent = async () => {
530
550
}
531
551
532
552
// delete entity
533
- if (e .key === ' m ' ) {
553
+ if (e .key === ' d ' ) {
534
554
entity .base ().onDelete (props .entity , _index .value )
535
555
}
536
556
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ export type VueEmitterName =
19
19
| 'entity-open-last'
20
20
| 'entity-not-mutate'
21
21
| 'entity-force-close'
22
+ | 'entity-update-area'
23
+ | 'entity-not-mutate-down'
22
24
| 'project-save'
23
25
| 'pdf-preview-exists'
24
26
Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ export const useEntity = () => {
198
198
const onDown = async ( entity : Entity , index : number ) => {
199
199
await nextTick
200
200
201
- emitter . emit ( 'entity-not-mutate' , entity )
201
+ emitter . emit ( 'entity-not-mutate-down ' , entity )
202
202
203
203
await nextTick
204
204
@@ -207,16 +207,6 @@ export const useEntity = () => {
207
207
direction : 'down' ,
208
208
} )
209
209
210
- emitter . emit ( 'entity-close' , { all : true } )
211
-
212
- await nextTick
213
-
214
- emitter . emit ( 'entity-open' , {
215
- entity,
216
- up : false ,
217
- switch : true ,
218
- } )
219
-
220
210
if ( index === CONTEXT . entities . length - 1 ) return
221
211
222
212
plugin . emit ( 'plugin-entity-swap' , {
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ export const useKeyboard = () => {
25
25
const project = useProject ( )
26
26
27
27
const init : Callback < void > = ( ) => {
28
- defaultPrevents ( )
29
28
saveLocal ( )
30
29
loadLocal ( )
31
30
newProject ( )
@@ -43,12 +42,6 @@ export const useKeyboard = () => {
43
42
keyboard . stop ( )
44
43
}
45
44
46
- const defaultPrevents = ( ) => {
47
- keyboard . bind ( 'ctrl > d' , ( e : Event ) => {
48
- utils . prevent ( e )
49
- } )
50
- }
51
-
52
45
const saveLocal = ( ) => {
53
46
keyboard . bind ( SHORTCUTS . localSaveProject [ 1 ] , ( e : Event ) => {
54
47
utils . prevent ( e )
You can’t perform that action at this time.
0 commit comments