From d379c5e10497bae204ad463629dadc7ccffbd1bf Mon Sep 17 00:00:00 2001 From: synth-ruiner Date: Fri, 6 Mar 2015 11:15:32 +0000 Subject: [PATCH] ipad support - hopefully --- index.html | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index c961122..914253c 100644 --- a/index.html +++ b/index.html @@ -260,7 +260,7 @@ } window.removeClearedRows = function() { - var rowsToRemove = $('#game ul').filter(function() { + var rowsToRemove = $('#game ul:not(.removing)').filter(function() { return $(this).checkRow(); }); @@ -268,6 +268,8 @@ if (rowsToRemove.length == 0) return; + rowsToRemove.addClass("removing"); + rowsToRemove.each(function() { score += $(this).children('.mine').length; @@ -371,10 +373,6 @@ return $(this).parent('ul').index(); } - $.fn.getGameboardPos = function() { - return gameBoard[$(this).getY()][$(this).getX()]; - } - $.fn.isMine = function() { return $(this).hasClass("mine"); } @@ -550,7 +548,7 @@ }); - $(document).on("mousedown", "li", function(event) { + $(document).on("mousedown touchstart", "li", function(event) { var x = $(this).getX(); var y = $(this).getY(); @@ -564,7 +562,7 @@ clearTimeout(timeout); }); - $(document).on("mouseup", "li", function(event) { + $(document).on("mouseup touchend", "li", function(event) { event.preventDefault(); clearTimeout(timeout);