Remove lazyload functionality entirely
It was merely a stopgap solution to the problem of the dialog taking forever to load. With that problem solved all of this awful code is no longer needed.
This commit is contained in:
committed by
Santhosh Thottingal
parent
8341bb8e21
commit
8a1e3eb18e
@@ -201,11 +201,7 @@
|
||||
defaultSearch: function () {
|
||||
this.$resultsView.lcd( 'empty' );
|
||||
|
||||
if ( this.options.lazyload ) {
|
||||
this.$regionFilters.first().regionselector( 'show' );
|
||||
} else {
|
||||
this.$regionFilters.regionselector( 'show' );
|
||||
}
|
||||
this.$regionFilters.regionselector( 'show' );
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -269,7 +265,6 @@
|
||||
languages: uls.languages,
|
||||
quickList: uls.options.quickList,
|
||||
clickhandler: $.proxy( uls.select, uls ),
|
||||
lazyload: uls.options.lazyload,
|
||||
source: uls.$languageFilter,
|
||||
showRegions: uls.options.showRegions
|
||||
} ).data( 'lcd' );
|
||||
@@ -412,7 +407,6 @@
|
||||
searchAPI: null, // Language search API
|
||||
languages: $.uls.data.getAutonyms(), // Languages to be used for ULS, default is all languages
|
||||
quickList: null, // Array of language codes or function that returns such
|
||||
lazyload: false, // Whether to lazy load the language list when scrolled
|
||||
compact: false, // Show ULS in compact mode
|
||||
showRegions: ['WW', 'AM', 'EU', 'ME', 'AF', 'AS', 'PA']
|
||||
};
|
||||
|
||||
@@ -287,11 +287,6 @@
|
||||
scrollTop = $ulsLanguageList.position().top,
|
||||
scrollBottom = $ulsLanguageList.height();
|
||||
|
||||
if ( lcd.options.lazyload && lcd.options.source.val() === '' ) {
|
||||
if ( this.offsetHeight + this.scrollTop >= this.scrollHeight / 2 ) {
|
||||
lcd.$element.trigger( 'scrollend' );
|
||||
}
|
||||
}
|
||||
// The region section need to be in sync with the map filter.
|
||||
inviewRegion = 'WW';
|
||||
lcd.$element.find( 'div.uls-lcd-region-section' ).each( function () {
|
||||
@@ -332,8 +327,7 @@
|
||||
|
||||
$.fn.lcd.defaults = {
|
||||
languages: null,
|
||||
showRegions: ['WW', 'AM', 'EU', 'ME', 'AF', 'AS', 'PA'],
|
||||
lazyload: false
|
||||
showRegions: ['WW', 'AM', 'EU', 'ME', 'AF', 'AS', 'PA']
|
||||
};
|
||||
|
||||
$.fn.lcd.Constructor = LanguageCategoryDisplay;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
/* RegionSelector plugin definition */
|
||||
|
||||
var RegionSelector, delay;
|
||||
var RegionSelector;
|
||||
|
||||
/**
|
||||
* Region selector is a language selector based on regions.
|
||||
@@ -138,32 +138,8 @@
|
||||
$target.append( langCode, region );
|
||||
},
|
||||
|
||||
next: function () {
|
||||
var regionSelector = this;
|
||||
|
||||
if ( !this.$element.hasClass( 'active' ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Do not respond to all scroll end events, but only after a short interval
|
||||
delay( function () {
|
||||
var nextRegionGroupNumber = regionSelector.$element.data( 'regiongroup' ) + 1,
|
||||
$nextRegion = $( '#uls-region-' + nextRegionGroupNumber ),
|
||||
nextRegionSelector = $nextRegion.length && $nextRegion.data( 'regionselector' );
|
||||
|
||||
// If cache is defined, then it is already rendered and there's no need
|
||||
// to re-render it.
|
||||
if ( nextRegionSelector && nextRegionSelector.cache === null ) {
|
||||
nextRegionSelector.show();
|
||||
}
|
||||
}, 100 );
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
listen: function () {
|
||||
this.$element.on( 'click', $.proxy( this.click, this ) );
|
||||
this.options.$target.$element.bind( 'scrollend', $.proxy( this.next, this ) );
|
||||
},
|
||||
|
||||
click: function () {
|
||||
@@ -212,12 +188,4 @@
|
||||
|
||||
$.fn.regionselector.Constructor = RegionSelector;
|
||||
|
||||
delay = ( function () {
|
||||
var timer = 0;
|
||||
return function ( callback, milliseconds ) {
|
||||
clearTimeout( timer );
|
||||
timer = setTimeout( callback, milliseconds );
|
||||
};
|
||||
} () );
|
||||
|
||||
} ( jQuery ) );
|
||||
|
||||
Reference in New Issue
Block a user