Simplify by using native JavaScript instead of jQuery
Still use $.each for iterating over an Object because there is no adequate function in ES5. Change-Id: Idbec13c471e75a9cd5d67204d54bededdbd5582b
This commit is contained in:
@@ -40,9 +40,9 @@
|
||||
$langselector = $( 'select#language' );
|
||||
|
||||
function listFonts( fonts ) {
|
||||
$.merge( fonts, [ 'Sans', 'Serif' ] );
|
||||
fonts.push( 'Sans', 'Serif' );
|
||||
$fontSelector.find( 'option' ).remove();
|
||||
$.each( fonts, function ( key, font ) {
|
||||
fonts.forEach( function ( font ) {
|
||||
$fontSelector.append( $( "<option></option>" )
|
||||
.attr( "value", font ).text( font ) );
|
||||
} );
|
||||
@@ -50,7 +50,7 @@
|
||||
}
|
||||
|
||||
listFonts( fonts );
|
||||
$.each( languages, function ( lang, language ) {
|
||||
languages.forEach( function ( language ) {
|
||||
$langselector.append( $( "<option></option>" )
|
||||
.attr( 'value', language )
|
||||
.text( language + " - " + $.uls.data.getAutonym( language ) ) );
|
||||
|
||||
Reference in New Issue
Block a user