tweak crowded crazyhouse pocket

This commit is contained in:
Thibault Duplessis 2016-01-20 20:38:12 +07:00
parent bf3eba5171
commit dd8f5aa764
2 changed files with 3 additions and 3 deletions

View file

@ -25,10 +25,10 @@ module.exports = {
if (!step.crazy) return;
var pocket = step.crazy.pockets[color === 'white' ? 0 : 1];
var oKeys = Object.keys(pocket)
var crowded = oKeys.length > 4;
var crowded = oKeys.length >= 4;
var usable = color === ctrl.chessground.data.movable.color;
return m('div', {
class: 'pocket ' + position + (oKeys.length > 4 ? ' crowded' : '') + (usable ? ' usable' : ''),
class: 'pocket ' + position + (crowded ? ' crowded' : '') + (usable ? ' usable' : ''),
config: function(el, isUpdate, context) {
if (isUpdate) return;
var onstart = partial(crazyDrag, ctrl, color);

View file

@ -27,7 +27,7 @@ module.exports = {
if (!step.crazy) return;
var pocket = step.crazy.pockets[color === 'white' ? 0 : 1];
var oKeys = Object.keys(pocket)
var crowded = oKeys.length > 4;
var crowded = oKeys.length >= 4;
var usable = position === 'bottom' && !ctrl.replaying() && game.isPlayerPlaying(ctrl.data);
return m('div', {
class: 'pocket ' + position + (oKeys.length > 4 ? ' crowded' : '') + (usable ? ' usable' : ''),