From e0f1100dbf04df1ff3f915dc4aabd442d46dea19 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Fri, 3 Sep 2021 22:55:54 +0300 Subject: [PATCH] [themes] refactoring. skip es6 syntax --- apps/common/main/lib/controller/Themes.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/common/main/lib/controller/Themes.js b/apps/common/main/lib/controller/Themes.js index e2a7deabfc..8700022643 100644 --- a/apps/common/main/lib/controller/Themes.js +++ b/apps/common/main/lib/controller/Themes.js @@ -228,13 +228,14 @@ define([ 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-') ) { - if ( themes_map[i[1]] ) { - theme_name = i[1]; + document.body.classList.forEach(function (classname, i, o) { + if ( !theme_name && classname.startsWith('theme-') && + !classname.startsWith('theme-type-') && themes_map[classname] ) + { + theme_name = classname; Common.localStorage.setItem('ui-theme-id', theme_name); - break; } - } + }); } }