diff options
| author | bobzel <zzzman@gmail.com> | 2022-07-21 13:28:25 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2022-07-21 13:28:25 -0400 |
| commit | 8f0752368e4c5831b909050940dff42171d51ae7 (patch) | |
| tree | 0671a690c3470eefb51104af133b6dd5aa81337a /src/client/views/nodes/formattedText/FormattedTextBox.tsx | |
| parent | 2c833fe4e7915b8219c6b48abb596e4359744750 (diff) | |
fixed undo for opening/closing sidebar for pdf/web/text. fixed lightboxview for pdf's with smaller heights.
Diffstat (limited to 'src/client/views/nodes/formattedText/FormattedTextBox.tsx')
| -rw-r--r-- | src/client/views/nodes/formattedText/FormattedTextBox.tsx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index e945920da..383c22ba8 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -640,7 +640,18 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FieldViewProps this.layoutDoc._width = !preview && this.SidebarShown ? NumCast(this.layoutDoc._width) * 2 : Math.max(20, NumCast(this.layoutDoc._width) - prevWidth); }; sidebarDown = (e: React.PointerEvent) => { - setupMoveUpEvents(this, e, this.sidebarMove, emptyFunction, () => setTimeout(this.toggleSidebar), true); + const batch = UndoManager.StartBatch('sidebar'); + setupMoveUpEvents( + this, + e, + this.sidebarMove, + (e, movement, isClick) => !isClick && batch.end(), + () => { + this.toggleSidebar(); + batch.end(); + }, + true + ); }; sidebarMove = (e: PointerEvent, down: number[], delta: number[]) => { const bounds = this._ref.current!.getBoundingClientRect(); |
