Skip to content

Commit

Permalink
Add section with hardcoded settings in BrowserInterface.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mmenavas committed Nov 20, 2017
1 parent 8ee6c38 commit f91da53
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions js/BrowserInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@
*/
(function($) {

// Handle clicking on settings icon
/************ Start hard coded settings ******************/

// How long a non matching card is displayed once clicked.
var nonMatchingCardTime = 1000;

/************ End hard coded settings ******************/

// Handle clicking on settings icon
var settings = document.getElementById('memory--settings-icon');
var modal = document.getElementById('memory--settings-modal');
var handleOpenSettings = function (event) {
Expand All @@ -20,7 +27,7 @@
};
settings.addEventListener('click', handleOpenSettings);

// Handle settings form submission
// Handle settings form submission
var reset = document.getElementById('memory--settings-reset');
var handleSettingsSubmission = function (event) {
event.preventDefault();
Expand Down Expand Up @@ -58,7 +65,7 @@
var childNodes = document.getElementById('memory--cards').childNodes;
childNodes[status.args[0]].classList.remove('clicked');
childNodes[status.args[1]].classList.remove('clicked');
}.bind(status), 500);
}.bind(status), nonMatchingCardTime);
}
else if (status.code == 4) {
var score = parseInt((($.attempts - $.mistakes) / $.attempts) * 100, 10);
Expand Down

0 comments on commit f91da53

Please sign in to comment.