mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 23:47:33 +08:00
add more supported font size
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ const serverSettingsCookieKey = 'ebk_server_settings';
|
||||
|
||||
const defaultSettings = {
|
||||
theme: 'auto',
|
||||
fontSize: 'default',
|
||||
fontSize: 0,
|
||||
timeZone: '',
|
||||
debug: false,
|
||||
applicationLock: false,
|
||||
|
||||
+13
-12
@@ -1,5 +1,6 @@
|
||||
import { f7, f7ready } from 'framework7-vue';
|
||||
|
||||
import fontConstants from '@/consts/font.js';
|
||||
import settings from './settings.js';
|
||||
import {
|
||||
getLocalizedError,
|
||||
@@ -130,18 +131,18 @@ export function autoChangeTextareaSize(el) {
|
||||
});
|
||||
}
|
||||
|
||||
export function setAppFontSize(value) {
|
||||
let fontSizeClass = 'font-default';
|
||||
export function setAppFontSize(type) {
|
||||
const htmlElement = elements('html');
|
||||
|
||||
if (value === 'extraLarge') {
|
||||
fontSizeClass = 'font-extra-large';
|
||||
} else if (value === 'large') {
|
||||
fontSizeClass = 'font-large';
|
||||
for (let i = 0; i < fontConstants.allFontSizeArray.length; i++) {
|
||||
const fontSizeType = fontConstants.allFontSizeArray[i];
|
||||
|
||||
if (fontSizeType.type === type) {
|
||||
if (!htmlElement.hasClass(fontSizeType.className)) {
|
||||
htmlElement.addClass(fontSizeType.className);
|
||||
}
|
||||
} else {
|
||||
htmlElement.removeClass(fontSizeType.className);
|
||||
}
|
||||
}
|
||||
|
||||
elements('html')
|
||||
.removeClass('font-default')
|
||||
.removeClass('font-large')
|
||||
.removeClass('font-extra-large')
|
||||
.addClass(fontSizeClass);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user