From 32758e2e4bcc64e5715343ad53cd6ad3239dd9cd Mon Sep 17 00:00:00 2001 From: Waseem Daher Date: Fri, 5 Oct 2012 13:22:43 -0400 Subject: [PATCH] Don't have scrollhandler fire when the 'home' tab isn't active. (imported from commit 242591730e5ce108c511e4eeaad7589d768b1b94) --- zephyr/static/js/ui.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/zephyr/static/js/ui.js b/zephyr/static/js/ui.js index ed6c67029e..5fce6f673a 100644 --- a/zephyr/static/js/ui.js +++ b/zephyr/static/js/ui.js @@ -120,10 +120,12 @@ $(function () { var last_mousewheel_or_scroll = 0; function do_mousewheel_or_scroll () { - var time = $.now(); - if (time - last_mousewheel_or_scroll > 50) { - keep_pointer_in_view(); - last_mousewheel_or_scroll = time; + if ($('#home').hasClass('active')) { + var time = $.now(); + if (time - last_mousewheel_or_scroll > 50) { + keep_pointer_in_view(); + last_mousewheel_or_scroll = time; + } } } $(window).mousewheel(do_mousewheel_or_scroll);