From b2777666b8cb9f87be3fcd83dcc17fa674beca70 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Fri, 3 Sep 2021 12:25:52 +0300 Subject: [PATCH] [themes] refactoring. skip es6 syntax --- apps/common/main/lib/controller/Themes.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/common/main/lib/controller/Themes.js b/apps/common/main/lib/controller/Themes.js index a6aa6cced7..67d095eb52 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] )