diff options
| author | bobzel <zzzman@gmail.com> | 2020-10-21 12:14:28 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-10-21 12:14:28 -0400 |
| commit | a4321991ae32044be01606f0f2635468edc3887e (patch) | |
| tree | bfa1ca0d323411353e17d9fd658b07a4ec25c09c /src/client/views/nodes/PresBox.tsx | |
| parent | 55053983adc5b1b29efa0b2f38df5a58dfb93d42 (diff) | |
cleaned up title eidting/slide selection in PresElement/PresBox/EditableView
Diffstat (limited to 'src/client/views/nodes/PresBox.tsx')
| -rw-r--r-- | src/client/views/nodes/PresBox.tsx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index 9723937a7..b19cba585 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -707,6 +707,22 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema> this.selectPres(); } + //regular click + @action + regularSelect = (doc: Doc, ref: HTMLElement, drag: HTMLElement, focus: boolean) => { + this._selectedArray.splice(0, this._selectedArray.length, doc); + this._eleArray.splice(0, this._eleArray.length, ref); + this._dragArray.splice(0, this._dragArray.length, drag); + focus && this.selectElement(doc); + this.selectPres(); + } + + modifierSelect = (doc: Doc, ref: HTMLElement, drag: HTMLElement, focus: boolean, cmdClick: boolean, shiftClick: boolean) => { + if (cmdClick) this.multiSelect(doc, ref, drag); + else if (shiftClick) this.shiftSelect(doc, ref, drag); + else this.regularSelect(doc, ref, drag, focus); + } + // Key for when the presentaiton is active @undoBatch keyEvents = action((e: KeyboardEvent) => { |
