From 5760df80d366712df22b8b57ab6467fd36dbe014 Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Tue, 21 Aug 2012 17:44:23 +0530 Subject: [PATCH] Bind the language links using jquery on and not in loop Change-Id: Ic4d2dd2b06acae57060bced9938a219bf8cebd73 --- lib/jquery.uls/src/jquery.uls.lcd.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/jquery.uls/src/jquery.uls.lcd.js b/lib/jquery.uls/src/jquery.uls.lcd.js index 9b3c062a..e7e291fa 100644 --- a/lib/jquery.uls/src/jquery.uls.lcd.js +++ b/lib/jquery.uls/src/jquery.uls.lcd.js @@ -82,12 +82,6 @@ } $column.append( $li ); - - if ( that.options.clickhandler ) { - $li.click( function() { - that.options.clickhandler.call( this, langCode ); - } ); - } } }, /** @@ -144,6 +138,11 @@ listen: function() { var that = this; + if ( this.options.clickhandler ) { + this.$element.on( 'click', 'div.row li', function() { + that.options.clickhandler.call( this, $( this ).data( 'code' ) ); + } ); + } // The region section need to be in sync with the map filter. that.$element.scroll( function () { var inviewRegion = that.$element.find( 'div.uls-lcd-region-section:first' ).attr( 'id' );