ipad support - hopefully

This commit is contained in:
synth-ruiner 2015-03-06 11:15:32 +00:00
parent c75ff197f8
commit d379c5e104
1 changed files with 5 additions and 7 deletions

View File

@ -260,7 +260,7 @@
} }
window.removeClearedRows = function() { window.removeClearedRows = function() {
var rowsToRemove = $('#game ul').filter(function() { var rowsToRemove = $('#game ul:not(.removing)').filter(function() {
return $(this).checkRow(); return $(this).checkRow();
}); });
@ -268,6 +268,8 @@
if (rowsToRemove.length == 0) return; if (rowsToRemove.length == 0) return;
rowsToRemove.addClass("removing");
rowsToRemove.each(function() { rowsToRemove.each(function() {
score += $(this).children('.mine').length; score += $(this).children('.mine').length;
@ -371,10 +373,6 @@
return $(this).parent('ul').index(); return $(this).parent('ul').index();
} }
$.fn.getGameboardPos = function() {
return gameBoard[$(this).getY()][$(this).getX()];
}
$.fn.isMine = function() { $.fn.isMine = function() {
return $(this).hasClass("mine"); 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 x = $(this).getX();
var y = $(this).getY(); var y = $(this).getY();
@ -564,7 +562,7 @@
clearTimeout(timeout); clearTimeout(timeout);
}); });
$(document).on("mouseup", "li", function(event) { $(document).on("mouseup touchend", "li", function(event) {
event.preventDefault(); event.preventDefault();
clearTimeout(timeout); clearTimeout(timeout);