]> git.sesse.net Git - remoteglot/blobdiff - www/js/chessboard-0.3.0.js
Unbreak dragging again.
[remoteglot] / www / js / chessboard-0.3.0.js
index 412df0225ddbaed8035d0ea768633f9c8c71e5c0..f69d0ed3802968a07c2ee533464565c82cb7a88e 100644 (file)
@@ -1247,7 +1247,7 @@ function mousedownSquare(e) {
   }
 
   // do nothing if we're not draggable
-  if (cfg.draggable) return;
+  if (!cfg.draggable) return;
 
   beginDraggingPiece(square, CURRENT_POSITION[square], e.pageX, e.pageY);
 }
@@ -1259,7 +1259,7 @@ function touchstartSquare(e) {
   }
 
   // do nothing if we're not draggable
-  if (cfg.draggable) return;
+  if (!cfg.draggable) return;
 
   var square = target.getAttribute('data-square');
 
@@ -1302,10 +1302,6 @@ function touchendWindow(e) {
   // do nothing if we are not dragging a piece
   if (!DRAGGING_A_PIECE) return;
 
-  // get the location
-  var location = isXYOnSquare(e.changedTouches[0].pageX,
-    e.changedTouches[0].pageY);
-
   stopDraggedPiece(findSquareFromEvent(e.changedTouches[0].pageX,
     e.changedTouches[0].pageY));
 }