summaryrefslogtreecommitdiffstats
path: root/ui/src/utils.ts
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-06-02 19:58:28 -0400
committerDessalines <tyhou13@gmx.com>2020-06-02 19:58:28 -0400
commitb1b9568c96ca2d0371d28171687af9a5f63ef959 (patch)
tree84f8b53530381b24e12240840956a44e91e75415 /ui/src/utils.ts
parent1e88b815da1225aa0b6caa5bce161983f75c7339 (diff)
Adding text-body class to message toast. Fixes #736
Diffstat (limited to 'ui/src/utils.ts')
-rw-r--r--ui/src/utils.ts14
1 files changed, 10 insertions, 4 deletions
diff --git a/ui/src/utils.ts b/ui/src/utils.ts
index 69afc7a4..bb1b6d90 100644
--- a/ui/src/utils.ts
+++ b/ui/src/utils.ts
@@ -394,17 +394,22 @@ export function setTheme(theme: string = 'darkly') {
}
// Load the theme dynamically
- if (!document.getElementById(theme)) {
+ let cssLoc = `/static/assets/css/themes/${theme}.min.css`;
+ loadCss(theme, cssLoc);
+ document.getElementById(theme).removeAttribute('disabled');
+}
+
+export function loadCss(id: string, loc: string) {
+ if (!document.getElementById(id)) {
var head = document.getElementsByTagName('head')[0];
var link = document.createElement('link');
- link.id = theme;
+ link.id = id;
link.rel = 'stylesheet';
link.type = 'text/css';
- link.href = `/static/assets/css/themes/${theme}.min.css`;
+ link.href = loc;
link.media = 'all';
head.appendChild(link);
}
- document.getElementById(theme).removeAttribute('disabled');
}
export function objectFlip(obj: any) {
@@ -474,6 +479,7 @@ export function messageToastify(
text: `${body}<br />${creator}`,
avatar: avatar,
backgroundColor: backgroundColor,
+ className: 'text-body',
close: true,
gravity: 'top',
position: 'right',