Initial whitespace cleanup

This commit is contained in:
Amir E. Aharoni
2012-10-08 17:04:05 +02:00
parent dfe6fcbb13
commit 2e22c5c550

View File

@@ -250,6 +250,7 @@
listen: function () { listen: function () {
var that = this; var that = this;
if ( this.options.clickhandler ) { if ( this.options.clickhandler ) {
this.$element.on( 'click', 'div.row li', function() { this.$element.on( 'click', 'div.row li', function() {
that.options.clickhandler.call( this, $( this ).data( 'code' ) ); that.options.clickhandler.call( this, $( this ).data( 'code' ) );
@@ -258,28 +259,30 @@
// The region section need to be in sync with the map filter. // The region section need to be in sync with the map filter.
that.$element.scroll( function () { that.$element.scroll( function () {
var scrollTop = $( this ).position().top; var scrollTop = $( this ).position().top,
var scrollBottom = $( this ).height(); scrollBottom = $( this ).height();
if ( this.offsetHeight + this.scrollTop >= this.scrollHeight/2 ) {
if ( this.offsetHeight + this.scrollTop >= this.scrollHeight / 2 ) {
that.$element.trigger( 'scrollend' ); that.$element.trigger( 'scrollend' );
} }
// The region section need to be in sync with the map filter. // The region section need to be in sync with the map filter.
var inviewRegion = 'WW'; var inviewRegion = 'WW';
that.$element.find( 'div.uls-lcd-region-section' ).each( function () { that.$element.find( 'div.uls-lcd-region-section' ).each( function () {
var top = $( this ).position().top; var top = $( this ).position().top,
var height = $( this ).height(); height = $( this ).height();
if ( top < scrollTop && height > scrollBottom ) { if ( top < scrollTop && height > scrollBottom ) {
inviewRegion = $( this ).attr( 'id' ); inviewRegion = $( this ).attr( 'id' );
return true; return true;
} }
} ); } );
var inview = $.uls.data.regiongroups[inviewRegion]; var inview = $.uls.data.regiongroups[inviewRegion];
$( '.regionselector' ).removeClass( 'active' ); $( '.regionselector' ).removeClass( 'active' );
$( '#uls-region-' + inview ).addClass( 'active' ); $( '#uls-region-' + inview ).addClass( 'active' );
} ); } );
} }
}; };
$.fn.lcd = function( option ) { $.fn.lcd = function( option ) {