diff --git a/apps/common/main/lib/controller/Themes.js b/apps/common/main/lib/controller/Themes.js index a6aa6cced..67d095eb5 100644 --- a/apps/common/main/lib/controller/Themes.js +++ b/apps/common/main/lib/controller/Themes.js @@ -249,12 +249,11 @@ define([ var theme_name = get_ui_theme_name(Common.localStorage.getItem('ui-theme')); if ( !theme_name ) { if ( !(Common.Utils.isIE10 || Common.Utils.isIE11) ) - for (var i of document.body.classList.entries()) { - if ( i[1].startsWith('theme-') && !i[1].startsWith('theme-type-') ) { - theme_name = i[1]; - break; + document.body.classList.forEach(function (classname, i, o) { + if ( !theme_name && classname.startsWith('theme-') && !classname.startsWith('theme-type-') ) { + theme_name = classname; } - } + }); } if ( !themes_map[theme_name] )