diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-12-02 12:25:15 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-12-02 12:25:15 -0500 |
commit | 8c7dd0561d18b1828b399f385d9d8558c583a503 (patch) | |
tree | 78e064da7b8dcc6caccda76cb0f1aec91d95abeb /web/react/utils | |
parent | 2b7ce16ea906e76211da3500fe134397f57caefe (diff) | |
parent | 13e55cd8ec006ab1fa0adbc50bd1ef5294b3a5eb (diff) | |
download | chat-8c7dd0561d18b1828b399f385d9d8558c583a503.tar.gz chat-8c7dd0561d18b1828b399f385d9d8558c583a503.tar.bz2 chat-8c7dd0561d18b1828b399f385d9d8558c583a503.zip |
Merge pull request #1581 from mattermost/font-fix
Stop firefox from crashing due to fonts
Diffstat (limited to 'web/react/utils')
-rw-r--r-- | web/react/utils/utils.jsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 9f80f1bb8..d2dd6cf38 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -696,8 +696,10 @@ export function applyTheme(theme) { export function applyFont(fontName) { const body = document.querySelector('body'); - body.classList.forEach((className) => { - if (className.lastIndexOf('font') === 0) { + const keys = Object.getOwnPropertyNames(body.classList); + keys.forEach((k) => { + const className = body.classList[k]; + if (className && className.lastIndexOf('font') === 0) { body.classList.remove(className); } }); |