use forEach() instead of for(i=0...)
This commit is contained in:
parent
9720d1dcd1
commit
dd752c8db0
1 changed files with 6 additions and 8 deletions
14
js/uhr.js
14
js/uhr.js
|
@ -162,20 +162,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
// language chooser
|
||||
if (uhrGlobals.languages.length > 1) {
|
||||
var languageChooser = $('<select id="uhr-languagechooser' + uhr.id + '"></select>');
|
||||
for (var i = 0; i < uhrGlobals.languages.length; i++) {
|
||||
var language = uhrGlobals.languages[i];
|
||||
languageChooser.append('<option value="' + language.code + '">' + language.language + '</option>');
|
||||
}
|
||||
uhrGlobals.languages.forEach(function (item) {
|
||||
languageChooser.append('<option value="' + item.code + '">' + item.language + '</option>');
|
||||
});
|
||||
e.after(languageChooser);
|
||||
}
|
||||
|
||||
// theme chooser
|
||||
if (uhrGlobals.themes.length > 1) {
|
||||
var themeChooser = $('<select id="uhr-themechooser' + uhr.id + '"></select>');
|
||||
for (var i = 0; i < uhrGlobals.themes.length; i++) {
|
||||
var theme = uhrGlobals.themes[i];
|
||||
themeChooser.append('<option value="' + theme.styleClass + '">' + theme.name + '</option>');
|
||||
}
|
||||
uhrGlobals.themes.forEach(function (item) {
|
||||
themeChooser.append('<option value="' + item.styleClass + '">' + item.name + '</option>');
|
||||
});
|
||||
e.after(themeChooser);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue