summaryrefslogtreecommitdiffstats
path: root/web/react/utils/utils.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-12-02 10:18:42 -0500
committerChristopher Speller <crspeller@gmail.com>2015-12-02 10:18:42 -0500
commit2aa78002fe73d82f67fac83430ce3210749f79a3 (patch)
tree489dab3f1efdec3efa6fdaed6224b7e0b0c4c3ff /web/react/utils/utils.jsx
parent7678d4aafa17a27da897925a169931d1c2cb07fc (diff)
parent42bf8173bd2dca7cb6c33c2df98c399958c6ef15 (diff)
downloadchat-2aa78002fe73d82f67fac83430ce3210749f79a3.tar.gz
chat-2aa78002fe73d82f67fac83430ce3210749f79a3.tar.bz2
chat-2aa78002fe73d82f67fac83430ce3210749f79a3.zip
Merge pull request #1535 from florianorben/PLT-1233
PLT-1233: "Display Font" option in Account Settings > Display
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r--web/react/utils/utils.jsx11
1 files changed, 11 insertions, 0 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index d6ed34e70..9f80f1bb8 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -693,6 +693,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');