From 9f3c815c1cc9fa0b68771487362065bd8df9a17e Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Thu, 3 Nov 2011 00:15:00 -0400 Subject: [PATCH] fixed (recently broken) mark/flip on client --- client.coffee | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client.coffee b/client.coffee index 56c665d..967917d 100644 --- a/client.coffee +++ b/client.coffee @@ -264,23 +264,23 @@ init = -> if z > top_card_z top_card_z = z update_pile_views() # ensures instantiation of all visible cards - if state.cards[card].view? # the card is visible + if @cards[card].view? # the card is visible # show it face down if it's in the other player's hand - state.cards[card].view.toggleClass 'your_hand', in_your_hand state.cards[card] + @cards[card].view.toggleClass 'your_hand', in_your_hand @cards[card] if agent is me tell_server ['move', agent, card, x, y, z, pile] else - if state.cards[card].view? - state.cards[card].view.css "z-index": z - state.cards[card].view.animate { left: "#{transform_x x}px", top: "#{transform_y y}px"}, 800 + if @cards[card].view? + @cards[card].view.css "z-index": z + @cards[card].view.animate { left: "#{transform_x x}px", top: "#{transform_y y}px"}, 800 state.on 'mark', (agent, card, state) -> - if state.cards[card].view? + if @cards[card].view? @cards[card].view.toggleClass 'marked', state if agent is me tell_server ['mark', agent, card, state] state.on 'flip', (agent, card, state) -> - if state.cards[card].view? + if @cards[card].view? @cards[card].view.toggleClass 'flipped', state if agent is me tell_server ['flip', agent, card, state] -- 1.7.10.4