mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 07:57:33 +08:00
support setting app font size
This commit is contained in:
@@ -8,6 +8,7 @@ const serverSettingsCookieKey = 'ebk_server_settings';
|
||||
|
||||
const defaultSettings = {
|
||||
theme: 'auto',
|
||||
fontSize: 'default',
|
||||
timeZone: '',
|
||||
debug: false,
|
||||
applicationLock: false,
|
||||
@@ -126,6 +127,8 @@ export default {
|
||||
isProduction: () => process.env.NODE_ENV === 'production',
|
||||
getTheme: () => getOption('theme'),
|
||||
setTheme: value => setOption('theme', value),
|
||||
getFontSize: () => getOption('fontSize'),
|
||||
setFontSize: value => setOption('fontSize', value),
|
||||
getTimezone: () => getOption('timeZone'),
|
||||
setTimezone: value => setOption('timeZone', value),
|
||||
isEnableDebug: () => getOption('debug'),
|
||||
|
||||
@@ -129,3 +129,19 @@ export function autoChangeTextareaSize(el) {
|
||||
el.style.height = el.scrollHeight + 'px';
|
||||
});
|
||||
}
|
||||
|
||||
export function setAppFontSize(value) {
|
||||
let fontSizeClass = 'font-default';
|
||||
|
||||
if (value === 'extraLarge') {
|
||||
fontSizeClass = 'font-extra-large';
|
||||
} else if (value === 'large') {
|
||||
fontSizeClass = 'font-large';
|
||||
}
|
||||
|
||||
elements('html')
|
||||
.removeClass('font-default')
|
||||
.removeClass('font-large')
|
||||
.removeClass('font-extra-large')
|
||||
.addClass(fontSizeClass);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user