Skip to content

Commit

Permalink
Handle only one touch point. Fixes Flyer53#191; Added node_module to …
Browse files Browse the repository at this point in the history
….gitignore.
  • Loading branch information
akstek committed Jul 22, 2022
1 parent 4a2994b commit 86ae323
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

node_modules
package-lock.json
12 changes: 12 additions & 0 deletions source/jspanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3189,6 +3189,7 @@ let jsPanel = {
let cursor = options.cursor || jsPanel.defaults.dragit.cursor;

function pointerUpHandlerDragit(e) {
self._pointerIsDown = false;
jsPanel.pointermove.forEach(e => document.removeEventListener(e, dragElmt));
jsPanel.removeSnapAreas();
if (dragstarted) {
Expand Down Expand Up @@ -3267,6 +3268,11 @@ let jsPanel = {

jsPanel.pointerdown.forEach(evt => {
handle.addEventListener(evt, e => {

// Prevent Multitouch
if (self._pointerIsDown) return;
self._pointerIsDown = true;

// disable dragging for all mouse buttons but left
if (e.button && e.button > 0) {
return false;
Expand Down Expand Up @@ -3765,6 +3771,7 @@ let jsPanel = {
}

function pointerUpHandlerResizeit(e) {
self._pointerIsDown = false;
jsPanel.pointermove.forEach(evt => document.removeEventListener(evt, resizePanel, false));
if (e.target.classList && e.target.classList.contains('jsPanel-resizeit-handle')) {
let isLeftChange,
Expand Down Expand Up @@ -3858,6 +3865,11 @@ let jsPanel = {
// prevent window scroll while resizing elmt
e.preventDefault();
e.stopPropagation();

// Prevent Multitouch
if (self._pointerIsDown) return;
self._pointerIsDown = true;

// disable resizing for all mouse buttons but left
if (e.button && e.button > 0) {
return false;
Expand Down

0 comments on commit 86ae323

Please sign in to comment.