Created
January 16, 2016 09:44
-
-
Save Tusko/b45cdf415952411314b5 to your computer and use it in GitHub Desktop.
wakaTimer
This file contains hidden or 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
| var wakaTimer; | |
| function blurWindow(){ | |
| wakaTimer = setInterval(function(){ | |
| handleAction(true); | |
| }, 5e3); | |
| } | |
| function setupEventListeners() { | |
| MainViewManager.on('currentFileChange', function () { | |
| handleAction(); | |
| }); | |
| DocumentManager.on('documentSaved', function () { | |
| handleAction(true); | |
| }); | |
| $(window).on('keypress', function () { | |
| handleAction(); | |
| }); | |
| $(window).on('blur', function () { | |
| blurWindow(); | |
| }); | |
| $(window).on('focus', function () { | |
| clearInterval(wakaTimer); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment