mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-29 15:51:20 +00:00
Adding text-body class to message toast. Fixes #736
This commit is contained in:
parent
1e88b815da
commit
b1b9568c96
1 changed files with 10 additions and 4 deletions
14
ui/src/utils.ts
vendored
14
ui/src/utils.ts
vendored
|
@ -394,17 +394,22 @@ export function setTheme(theme: string = 'darkly') {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the theme dynamically
|
// 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 head = document.getElementsByTagName('head')[0];
|
||||||
var link = document.createElement('link');
|
var link = document.createElement('link');
|
||||||
link.id = theme;
|
link.id = id;
|
||||||
link.rel = 'stylesheet';
|
link.rel = 'stylesheet';
|
||||||
link.type = 'text/css';
|
link.type = 'text/css';
|
||||||
link.href = `/static/assets/css/themes/${theme}.min.css`;
|
link.href = loc;
|
||||||
link.media = 'all';
|
link.media = 'all';
|
||||||
head.appendChild(link);
|
head.appendChild(link);
|
||||||
}
|
}
|
||||||
document.getElementById(theme).removeAttribute('disabled');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function objectFlip(obj: any) {
|
export function objectFlip(obj: any) {
|
||||||
|
@ -474,6 +479,7 @@ export function messageToastify(
|
||||||
text: `${body}<br />${creator}`,
|
text: `${body}<br />${creator}`,
|
||||||
avatar: avatar,
|
avatar: avatar,
|
||||||
backgroundColor: backgroundColor,
|
backgroundColor: backgroundColor,
|
||||||
|
className: 'text-body',
|
||||||
close: true,
|
close: true,
|
||||||
gravity: 'top',
|
gravity: 'top',
|
||||||
position: 'right',
|
position: 'right',
|
||||||
|
|
Loading…
Reference in a new issue