Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
Resolved igameproject#30

Disabled 'click' event listener and now using 'dblclick' event listener to select a panel. User has to double click on the panel to select it. Single clicking is disabled.
  • Loading branch information
kaulmesanyam committed Oct 10, 2019
1 parent 2e22b90 commit ca9b86c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions js/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


var first = null, second = null;
var tiles = 0;
var time = new Date().getTime();
Expand All @@ -14,7 +15,11 @@ $(document).ready(function(){
randomizeStartOffset();
transitionToStartPosition();

$(".front").click(function(){
$(".front").click(function(e){
e.preventDefault();
});

$(".front").dblclick(function(){
if(blockInput){
return;
}
Expand All @@ -40,7 +45,7 @@ $(document).ready(function(){
blockInput = true;
first.removeClass("activated").addClass("mismatch");
second.removeClass("activated").addClass("mismatch");
setTimeout(function() { resetWrongTiles(); }, 800);
setTimeout(function() { resetWrongTiles(); }, 700);
}
}
});
Expand Down

0 comments on commit ca9b86c

Please sign in to comment.