From a37c727ec1354a387a403964697f5a19928bce53 Mon Sep 17 00:00:00 2001 From: Rebecca Black Date: Mon, 13 May 2024 14:39:31 -0400 Subject: [PATCH] added touchscreen functionality for resizing --- astro-web/.gitignore | 3 +++ editioncrafter/src/component/SplitPaneView.js | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/astro-web/.gitignore b/astro-web/.gitignore index 6d4c0aa..7b1a23d 100644 --- a/astro-web/.gitignore +++ b/astro-web/.gitignore @@ -19,3 +19,6 @@ pnpm-debug.log* # macOS-specific files .DS_Store + +# github workflows +.github diff --git a/editioncrafter/src/component/SplitPaneView.js b/editioncrafter/src/component/SplitPaneView.js index 3b25878..d697f7a 100644 --- a/editioncrafter/src/component/SplitPaneView.js +++ b/editioncrafter/src/component/SplitPaneView.js @@ -109,8 +109,8 @@ class SplitPaneView extends Component { componentDidMount() { this.updateUI(); - window.addEventListener('mousemove', this.onDrag); - window.addEventListener('mouseup', this.onEndDrag); + window.addEventListener('pointermove', this.onDrag); + window.addEventListener('pointerup', this.onEndDrag); window.addEventListener('resize', this.onResize); console.log(this.props); // Set the default width on mount @@ -129,8 +129,8 @@ class SplitPaneView extends Component { } componentWillUnmount() { - window.removeEventListener('mousemove', this.onDrag); - window.removeEventListener('mouseup', this.onEndDrag); + window.removeEventListener('pointermove', this.onDrag); + window.removeEventListener('pointerup', this.onEndDrag); window.removeEventListener('resize', this.onResize); } @@ -138,7 +138,7 @@ class SplitPaneView extends Component { const drawerIconClass = 'drawer-icon fas fa-caret-left fa-2x'; return ( -
this.onStartDrag(position)}> +
this.onStartDrag(position)}>