From de1f64d1f8efd61966f26ffae16ab261b8b65c32 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Wed, 15 Jul 2015 13:40:22 +0300 Subject: Fix home animation --- client/button.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'client/button.js') 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(); -- cgit v1.3.1