Last active
February 8, 2021 09:12
-
-
Save jakewilliami/cb455bf11adbf879c92b9dfc3516c7df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gorilla = require('gorilla/gorilla'); | |
// Initialise the timer | |
var stateTimer: gorilla.GorillaTimerSequence; | |
// Add variable to determine delay | |
var allowedTime: number = 2000; // set original timer to 2 seconds (2000 milliseconds) | |
// check if textbox is selected | |
if ($(document.activeElement).attr("type") == "text" || $(document.activeElement).attr("type") == "textarea") { | |
// updated allowedTime | |
allowedTime = 5000; // 5 seconds (5000 milliseconds) | |
} | |
var stateTimer: gorilla.GorillaTimerSequence = gorilla.addTimerSequence() | |
.delay(allowedTime) // wait a certain amout of time | |
.then(() => { | |
// transition into your next stage | |
}) | |
}) | |
.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment