From 77e62c99a57e3d83b8d53c4ac5fb86167fabdd11 Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Mon, 8 Oct 2012 17:34:35 +0200 Subject: [PATCH] Changed $( this ) into meaningful variables --- src/jquery.uls.lcd.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/jquery.uls.lcd.js b/src/jquery.uls.lcd.js index 01c3147..7aef642 100644 --- a/src/jquery.uls.lcd.js +++ b/src/jquery.uls.lcd.js @@ -259,8 +259,9 @@ // The region section need to be in sync with the map filter. lcd.$element.scroll( function () { - var scrollTop = $( this ).position().top, - scrollBottom = $( this ).height(); + var $ulsLanguageList = $( this ), + scrollTop = $ulsLanguageList.position().top, + scrollBottom = $ulsLanguageList.height(); if ( this.offsetHeight + this.scrollTop >= this.scrollHeight / 2 ) { lcd.$element.trigger( 'scrollend' ); @@ -269,11 +270,12 @@ // The region section need to be in sync with the map filter. var inviewRegion = 'WW'; lcd.$element.find( 'div.uls-lcd-region-section' ).each( function () { - var top = $( this ).position().top, - height = $( this ).height(); + var $lcdRegionSection = $( this ), + top = $lcdRegionSection.position().top, + height = $lcdRegionSection.height(); if ( top < scrollTop && height > scrollBottom ) { - inviewRegion = $( this ).attr( 'id' ); + inviewRegion = $lcdRegionSection.attr( 'id' ); return true; } } );