]> git.sesse.net Git - remoteglot/commitdiff
Unbreak dragging again.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 29 Dec 2022 20:36:30 +0000 (21:36 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 29 Dec 2022 20:36:30 +0000 (21:36 +0100)
www/js/chessboard-0.3.0.js

index da71dc3409a665ec414f122e2353c2a8967666c8..f69d0ed3802968a07c2ee533464565c82cb7a88e 100644 (file)
@@ -1247,7 +1247,7 @@ function mousedownSquare(e) {
   }
 
   // do nothing if we're not draggable
   }
 
   // do nothing if we're not draggable
-  if (cfg.draggable) return;
+  if (!cfg.draggable) return;
 
   beginDraggingPiece(square, CURRENT_POSITION[square], e.pageX, e.pageY);
 }
 
   beginDraggingPiece(square, CURRENT_POSITION[square], e.pageX, e.pageY);
 }
@@ -1259,7 +1259,7 @@ function touchstartSquare(e) {
   }
 
   // do nothing if we're not draggable
   }
 
   // do nothing if we're not draggable
-  if (cfg.draggable) return;
+  if (!cfg.draggable) return;
 
   var square = target.getAttribute('data-square');
 
 
   var square = target.getAttribute('data-square');