diff options
| author | Yuval Adam <yuval@y3xz.com> | 2015-07-15 13:40:22 +0300 |
|---|---|---|
| committer | Yuval Adam <yuval@y3xz.com> | 2015-07-15 13:40:22 +0300 |
| commit | de1f64d1f8efd61966f26ffae16ab261b8b65c32 (patch) | |
| tree | 3325ee3feaa32ea6fdd8c301e9249799e8fc4172 | |
| parent | 0a8c9ec6b5d341850d3005f7c92c6ecfdebe4a62 (diff) | |
Fix home animation
| -rw-r--r-- | client/button.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/client/button.js b/client/button.js index f1f9123..476fc04 100644 --- a/client/button.js +++ b/client/button.js @@ -1,11 +1,15 @@ -$(document).ready(function () { - if (window.location.pathname == '/') { +Router.onRun(function () { + $(document).ready(function () { + if (window.logoInterval !== undefined) + clearInterval(window.logoInterval); + var i = 0; - setInterval(function() { + window.logoInterval = setInterval(function() { $('img.home-logo').attr('src', '/img/icons/1_' + ((++i%5)+1) + '.gif'); }, 2000); - } -}); + }); + this.next(); +}, { only: ['login'] }); function prepareDates() { var month = $('input[name=month]').val(); |
