diff options
Diffstat (limited to 'public/assets')
| -rw-r--r-- | public/assets/js/nav.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/public/assets/js/nav.js b/public/assets/js/nav.js index 247ed05..d1d9083 100644 --- a/public/assets/js/nav.js +++ b/public/assets/js/nav.js @@ -1,3 +1,5 @@ +var deferTimeout + var NavView = View.extend({ el: "body", @@ -94,6 +96,11 @@ var NavView = View.extend({ this.fetching = true this.onLatest = false console.log('fetch ascii') + clearTimeout(deferTimeout) + deferTimeout = setTimeout(function(){ + this.fetchAscii() + }.bind(this), 45000) + $.get("/p/get/randomascii", function(data){ // console.log(data) var asciiData = { @@ -107,6 +114,7 @@ var NavView = View.extend({ if (loaded) return loaded = true this.display(asciiData) + clearTimeout(deferTimeout) setTimeout(this.fetchAscii.bind(this), 15000) }.bind(this) img.onerror = function(){ |
