From 42bf8173bd2dca7cb6c33c2df98c399958c6ef15 Mon Sep 17 00:00:00 2001 From: Florian Orben Date: Sat, 28 Nov 2015 02:54:04 +0100 Subject: PLT-1233: "Display Font" option in Account Settings > Display --- web/react/utils/utils.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'web/react/utils/utils.jsx') diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 9b2f7e057..b3d1350b6 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -694,6 +694,17 @@ export function applyTheme(theme) { } updateCodeTheme(theme.codeTheme); } + +export function applyFont(fontName) { + const body = document.querySelector('body'); + body.classList.forEach((className) => { + if (className.lastIndexOf('font') === 0) { + body.classList.remove(className); + } + }); + body.classList.add(Constants.FONTS[fontName]); +} + export function changeCss(className, classValue, classRepeat) { // we need invisible container to store additional css definitions var cssMainContainer = $('#css-modifier-container'); -- cgit v1.2.3-1-g7c22