Merge remote-tracking branch 'origin/master' into gh-pages

This commit is contained in:
synth-ruiner 2015-03-09 23:19:29 +00:00
commit ac65928e32
1 changed files with 9 additions and 17 deletions

View File

@ -371,25 +371,17 @@
function refreshMineCounts() { function refreshMineCounts() {
$('li.revealed:not(.mine)').each(function() { $('li.revealed:not(.mine)').each(function() {
$(this).text( var mineCount = $(this).countMinesText();
$(this).countMinesText()
); $(this).text(mineCount);
//remove "mines1" etc //remove "mines1" etc
$(this).attr(
var mine = $(this).hasClass("mine"); 'class',
$(this).attr('class').replace(
$(this).removeAttr("class"); /mines[0-9]/, "mines" + mineCount
)
if (mine) {
$(this).addClass("mine");
} else {
$(this).addClass(
"mines" + $(this).countMinesText()
); );
}
$(this).addClass("revealed");
}); });
} }