Show the Common language section only if the list is long enough
This commit is contained in:
@@ -115,6 +115,8 @@
|
|||||||
|
|
||||||
render: function () {
|
render: function () {
|
||||||
var $section,
|
var $section,
|
||||||
|
language,
|
||||||
|
languagesCount = 0,
|
||||||
lcd = this,
|
lcd = this,
|
||||||
regions = [],
|
regions = [],
|
||||||
regionNames = {
|
regionNames = {
|
||||||
@@ -129,7 +131,24 @@
|
|||||||
PA: 'Pacific'
|
PA: 'Pacific'
|
||||||
};
|
};
|
||||||
|
|
||||||
regions.push( this.buildQuicklist() );
|
// IE8 does not support Object.keys
|
||||||
|
if ( Object.keys ) {
|
||||||
|
languagesCount = Object.keys( this.options.languages ).length;
|
||||||
|
} else {
|
||||||
|
for ( language in this.options.languages ) {
|
||||||
|
if ( Object.prototype.hasOwnProperty.call(
|
||||||
|
this.options.languages,
|
||||||
|
language
|
||||||
|
) ) {
|
||||||
|
languagesCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show the Common languages section, unless the list is very short
|
||||||
|
if ( languagesCount > 12 ) {
|
||||||
|
regions.push( this.buildQuicklist() );
|
||||||
|
}
|
||||||
|
|
||||||
$.each( $.uls.data.regiongroups, function ( regionCode ) {
|
$.each( $.uls.data.regiongroups, function ( regionCode ) {
|
||||||
lcd.regionLanguages[ regionCode ] = [];
|
lcd.regionLanguages[ regionCode ] = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user