diff options
| author | bobzel <zzzman@gmail.com> | 2024-01-04 22:29:17 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2024-01-04 22:29:17 -0500 |
| commit | de3ca90be367a8c763b07e315caaad6de79f3f96 (patch) | |
| tree | 1e01294f6a304180e46dca6b3533bfb934a4d37b /src/client/views/collections/CollectionNoteTakingViewDivider.tsx | |
| parent | 3c5813a032a5b59047f1e11b63e7f74c36b5b29e (diff) | |
fixed notetaking & pile views with _props
Diffstat (limited to 'src/client/views/collections/CollectionNoteTakingViewDivider.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionNoteTakingViewDivider.tsx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/client/views/collections/CollectionNoteTakingViewDivider.tsx b/src/client/views/collections/CollectionNoteTakingViewDivider.tsx index 2aad48d4a..5e4bce19d 100644 --- a/src/client/views/collections/CollectionNoteTakingViewDivider.tsx +++ b/src/client/views/collections/CollectionNoteTakingViewDivider.tsx @@ -3,6 +3,7 @@ import { observer } from 'mobx-react'; import * as React from 'react'; import { emptyFunction, setupMoveUpEvents } from '../../../Utils'; import { UndoManager } from '../../util/UndoManager'; +import { ObservableReactComponent } from '../ObservableReactComponent'; interface DividerProps { index: number; @@ -17,8 +18,7 @@ interface DividerProps { * are two simple vertical lines that allow the user to alter the widths of CollectionNoteTakingViewColumns. */ @observer -export class CollectionNoteTakingViewDivider extends React.Component<DividerProps> { - @observable private isHoverActive = false; +export class CollectionNoteTakingViewDivider extends ObservableReactComponent<DividerProps> { @observable private isResizingActive = false; @action @@ -29,12 +29,11 @@ export class CollectionNoteTakingViewDivider extends React.Component<DividerProp e, (e, down, delta) => { if (!batch) batch = UndoManager.StartBatch('resizing'); - this.props.setColumnStartXCoords(delta[0], this.props.index); + this._props.setColumnStartXCoords(delta[0], this._props.index); return false; }, action(() => { this.isResizingActive = false; - this.isHoverActive = false; batch?.end(); }), emptyFunction @@ -50,10 +49,8 @@ export class CollectionNoteTakingViewDivider extends React.Component<DividerProp display: 'flex', alignItems: 'center', cursor: 'col-resize', - pointerEvents: this.props.isContentActive() ? 'all' : 'none', - }} - onPointerEnter={action(() => (this.isHoverActive = true))} - onPointerLeave={action(() => !this.isResizingActive && (this.isHoverActive = false))}> + pointerEvents: this._props.isContentActive() ? 'all' : 'none', + }}> <div className="columnResizer-handler" onPointerDown={e => this.registerResizing(e)} |
