mirror of
https://github.com/heyman/heynote.git
synced 2024-11-24 17:03:19 +01:00
Set default font size to 16px in webapp for mobile devices in order to avoid auto zoom in when the keyboard appears on iOS Safari
This commit is contained in:
parent
c645b0bac8
commit
66e7082786
@ -20,6 +20,9 @@ import getCurrencyData from "./currency"
|
||||
|
||||
|
||||
contextBridge.exposeInMainWorld("heynote", {
|
||||
defaultFontFamily: "Hack",
|
||||
defaultFontSize: 12,
|
||||
|
||||
platform: {
|
||||
isMac,
|
||||
isWindows,
|
||||
|
@ -2,8 +2,10 @@
|
||||
import KeyboardHotkey from "./KeyboardHotkey.vue"
|
||||
import TabListItem from "./TabListItem.vue"
|
||||
import TabContent from "./TabContent.vue"
|
||||
import { defaultFontFamily, defaultFontSize } from "@/src/editor/theme/font-theme.js"
|
||||
|
||||
const defaultFontFamily = window.heynote.defaultFontFamily
|
||||
const defaultFontSize = window.heynote.defaultFontSize
|
||||
|
||||
export default {
|
||||
props: {
|
||||
initialKeymap: String,
|
||||
|
@ -1,14 +1,10 @@
|
||||
import { EditorView } from "@codemirror/view"
|
||||
|
||||
export const defaultFontFamily = "Hack"
|
||||
export const defaultFontSize = 12
|
||||
|
||||
|
||||
export function getFontTheme(fontFamily, fontSize) {
|
||||
fontSize = fontSize || defaultFontSize
|
||||
fontSize = fontSize || window.heynote.defaultFontSize
|
||||
return EditorView.theme({
|
||||
'.cm-scroller': {
|
||||
fontFamily: fontFamily || defaultFontFamily,
|
||||
fontFamily: fontFamily || window.heynote.defaultFontFamily,
|
||||
fontSize: (fontSize) + "px",
|
||||
},
|
||||
})
|
||||
|
@ -8,6 +8,8 @@ mediaMatch.addEventListener("change", async (event) => {
|
||||
}
|
||||
})
|
||||
|
||||
const isMobileDevice = window.matchMedia("(max-width: 600px)").matches
|
||||
|
||||
let autoUpdateCallbacks = null
|
||||
let currencyData = null
|
||||
|
||||
@ -74,6 +76,8 @@ if (settingsData !== null) {
|
||||
const Heynote = {
|
||||
platform: platform,
|
||||
isWebApp: true,
|
||||
defaultFontFamily: "Hack",
|
||||
defaultFontSize: isMobileDevice ? 16 : 12,
|
||||
|
||||
buffer: {
|
||||
async load() {
|
||||
|
Loading…
Reference in New Issue
Block a user