Middle click behaviour
Allow middle clicking for adjacent clicked mines as well as flagged mines
This commit is contained in:
parent
1442b7d5ad
commit
e4660cf7aa
|
@ -349,8 +349,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$.fn.middleClick = function() {
|
$.fn.middleClick = function() {
|
||||||
|
//move this functionality to left click
|
||||||
|
|
||||||
//number of flags matches number of adjacent mines
|
//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).getAdjacentTiles().filter(':not(.flagged)').each(function() {
|
||||||
$(this).mousedown();
|
$(this).mousedown();
|
||||||
});
|
});
|
||||||
|
@ -358,7 +360,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$.fn.rightClick = function() {
|
$.fn.rightClick = function() {
|
||||||
if (!$(this).hasClass("revealed")) {
|
if ($(this).hasClass("revealed")) {
|
||||||
|
//deploy a bomb!
|
||||||
|
//...
|
||||||
|
} else {
|
||||||
$(this).toggleClass("flagged");
|
$(this).toggleClass("flagged");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue