diff options
| author | bobzel <zzzman@gmail.com> | 2020-11-22 19:21:24 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-11-22 19:21:24 -0500 |
| commit | 759145d61aacb27922071a3796955c6d365cb4f4 (patch) | |
| tree | 2d77fffbbd343840719ca2336f1833a90b5e5ef5 /src | |
| parent | 6862403368f752ad44c9e64bfdbcb38d2c32287c (diff) | |
added ungroup with typing 'u'
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/views/GlobalKeyHandler.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/client/views/GlobalKeyHandler.ts b/src/client/views/GlobalKeyHandler.ts index 33c6af266..3f3d382e4 100644 --- a/src/client/views/GlobalKeyHandler.ts +++ b/src/client/views/GlobalKeyHandler.ts @@ -86,6 +86,15 @@ export class KeyManager { private unmodified = action((keyname: string, e: KeyboardEvent) => { switch (keyname) { + case "u": + if (document.activeElement?.tagName === "INPUT" || document.activeElement?.tagName === "TEXTAREA") { + return { stopPropagation: false, preventDefault: false }; + } + + const ungroupings = SelectionManager.SelectedDocuments().slice(); + UndoManager.RunInBatch(() => ungroupings.map(dv => dv.layoutDoc.group = undefined), "ungroup"); + SelectionManager.DeselectAll(); + break; case "g": if (document.activeElement?.tagName === "INPUT" || document.activeElement?.tagName === "TEXTAREA") { return { stopPropagation: false, preventDefault: false }; @@ -93,7 +102,7 @@ export class KeyManager { const groupings = SelectionManager.SelectedDocuments().slice(); const randomGroup = random(0, 1000); - UndoManager.RunInBatch(() => groupings.map(dv => dv.layoutDoc.group = randomGroup), "delete"); + UndoManager.RunInBatch(() => groupings.map(dv => dv.layoutDoc.group = randomGroup), "group"); SelectionManager.DeselectAll(); break; case " ": |
