Last active
August 29, 2015 14:27
-
-
Save IlyaDonskikh/5dcb658d53a8989807cd 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
lastActionTime = new Date() | |
syncInterval = 30000 | |
$('*').on 'blur change click dblclick error focus focusin focusout hover keydown keypress keyup load mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup resize scroll select submit', -> | |
lastActionTime = new Date() | |
setInterval (-> | |
currentTime = new Date() | |
timeLimit = currentTime - lastActionTime | |
if timeLimit > syncInterval | |
element = $('.add_last_messages_action_JS') | |
element.trigger('click') | |
lastActionTime = currentTime | |
), 500 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment