From e4660cf7aa65a570138c83d48e58047fe41548d8 Mon Sep 17 00:00:00 2001 From: synth-ruiner Date: Sun, 1 Mar 2015 14:55:37 +0000 Subject: [PATCH] Middle click behaviour Allow middle clicking for adjacent clicked mines as well as flagged mines --- index.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index e9a577f..a8f647c 100644 --- a/index.html +++ b/index.html @@ -349,8 +349,10 @@ } $.fn.middleClick = function() { + //move this functionality to left click + //number of flags matches number of adjacent mines - if ($(this).text() == $(this).getAdjacentTiles().filter('.flagged').length) { + if ($(this).text() == $(this).getAdjacentTiles().filter('.flagged, .revealed.mine').length) { $(this).getAdjacentTiles().filter(':not(.flagged)').each(function() { $(this).mousedown(); }); @@ -358,7 +360,10 @@ } $.fn.rightClick = function() { - if (!$(this).hasClass("revealed")) { + if ($(this).hasClass("revealed")) { + //deploy a bomb! + //... + } else { $(this).toggleClass("flagged"); } }