mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 14:07:04 +03:00
Some array.slice to array.startsWith and cleanup some JavaScript code
This commit is contained in:
parent
3903a37b64
commit
ffcc86805a
8 changed files with 83 additions and 146 deletions
|
|
@ -36,7 +36,7 @@ ThemeStore.fontSansSerif.subscribe(value => {
|
|||
if (null != value) {
|
||||
let cl = elementById('rl-app').classList;
|
||||
cl.forEach(name => {
|
||||
if ('font' === name.slice(0,4) && !/font(Serif|Mono)/.test(name)) {
|
||||
if (name.startsWith('font') && !/font(Serif|Mono)/.test(name)) {
|
||||
cl.remove(name);
|
||||
}
|
||||
});
|
||||
|
|
@ -46,22 +46,14 @@ ThemeStore.fontSansSerif.subscribe(value => {
|
|||
ThemeStore.fontSerif.subscribe(value => {
|
||||
if (null != value) {
|
||||
let cl = elementById('rl-app').classList;
|
||||
cl.forEach(name => {
|
||||
if ('fontSerif' === name.slice(0,9)) {
|
||||
cl.remove(name);
|
||||
}
|
||||
});
|
||||
cl.forEach(name => name.startsWith('fontSerif') && cl.remove(name));
|
||||
value && cl.add('fontSerif'+value);
|
||||
}
|
||||
});
|
||||
ThemeStore.fontMono.subscribe(value => {
|
||||
if (null != value) {
|
||||
let cl = elementById('rl-app').classList;
|
||||
cl.forEach(name => {
|
||||
if ('fontMono' === name.slice(0,9)) {
|
||||
cl.remove(name);
|
||||
}
|
||||
});
|
||||
cl.forEach(name => name.startsWith('fontMono') && cl.remove(name));
|
||||
value && cl.add('fontMono'+value);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue