From 65a25e62056a8ebe7120cd24375c331b5e9ad473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mart=C3=ADnez?= Date: Mon, 7 Mar 2016 12:15:27 +0100 Subject: [PATCH] Prevent flipping more than 2 cards at one Just to make sure no one is clicking more than two cards at time, which would be a little confusing for users. --- card.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/card.js b/card.js index 0c0a608..0607c1c 100644 --- a/card.js +++ b/card.js @@ -37,8 +37,10 @@ * Flip card. */ self.flip = function () { - $card.addClass('h5p-flipped'); - self.trigger('flip'); + if (jQuery('.h5p-flipped').length < 2) { + $card.addClass('h5p-flipped'); + self.trigger('flip'); + } }; /**