summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-12-02 12:25:15 -0500
committerChristopher Speller <crspeller@gmail.com>2015-12-02 12:25:15 -0500
commit8c7dd0561d18b1828b399f385d9d8558c583a503 (patch)
tree78e064da7b8dcc6caccda76cb0f1aec91d95abeb
parent2b7ce16ea906e76211da3500fe134397f57caefe (diff)
parent13e55cd8ec006ab1fa0adbc50bd1ef5294b3a5eb (diff)
downloadchat-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
-rw-r--r--web/react/utils/utils.jsx6
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);
}
});