From 86cdb1761cdc2262e743f832e17fa6edd5874127 Mon Sep 17 00:00:00 2001 From: Aaron Maturen Date: Fri, 7 Mar 2014 15:00:48 -0500 Subject: [PATCH] Fixing triggering the sticky keyword box --- hooks/search.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hooks/search.php b/hooks/search.php index 65f7280..4f7dc4e 100644 --- a/hooks/search.php +++ b/hooks/search.php @@ -48,13 +48,16 @@ function HookInline_keywordsSearchAdditionalheaderjs() }); - var panelTop = jQuery('.keywordPanel').eq(0).offset().top; - jQuery(window).scroll(function(){ - if(jQuery(window).scrollTop() > (panelTop - 20)){ - jQuery('.keywordPanel').css({'position':'fixed','top':'20px'}); - }else{ - jQuery('.keywordPanel').css({'position':'static','top':'20px'}); + jQuery('#UICenter').scroll(function(){ + var kpanel = jQuery('.keywordPanel'); + if(kpanel){ + var panelTop = kpanel.eq(0).offset().top; + if(jQuery('#UICenter').scrollTop() > (panelTop - 20)){ + jQuery('.keywordPanel').css({'position':'fixed','top':'20px'}); + }else{ + jQuery('.keywordPanel').css({'position':'static','top':'20px'}); + } } });