mirror of
https://github.com/heyman/heynote.git
synced 2025-06-26 12:32:00 +02: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", {
|
contextBridge.exposeInMainWorld("heynote", {
|
||||||
|
defaultFontFamily: "Hack",
|
||||||
|
defaultFontSize: 12,
|
||||||
|
|
||||||
platform: {
|
platform: {
|
||||||
isMac,
|
isMac,
|
||||||
isWindows,
|
isWindows,
|
||||||
|
@ -2,8 +2,10 @@
|
|||||||
import KeyboardHotkey from "./KeyboardHotkey.vue"
|
import KeyboardHotkey from "./KeyboardHotkey.vue"
|
||||||
import TabListItem from "./TabListItem.vue"
|
import TabListItem from "./TabListItem.vue"
|
||||||
import TabContent from "./TabContent.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 {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
initialKeymap: String,
|
initialKeymap: String,
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
import { EditorView } from "@codemirror/view"
|
import { EditorView } from "@codemirror/view"
|
||||||
|
|
||||||
export const defaultFontFamily = "Hack"
|
|
||||||
export const defaultFontSize = 12
|
|
||||||
|
|
||||||
|
|
||||||
export function getFontTheme(fontFamily, fontSize) {
|
export function getFontTheme(fontFamily, fontSize) {
|
||||||
fontSize = fontSize || defaultFontSize
|
fontSize = fontSize || window.heynote.defaultFontSize
|
||||||
return EditorView.theme({
|
return EditorView.theme({
|
||||||
'.cm-scroller': {
|
'.cm-scroller': {
|
||||||
fontFamily: fontFamily || defaultFontFamily,
|
fontFamily: fontFamily || window.heynote.defaultFontFamily,
|
||||||
fontSize: (fontSize) + "px",
|
fontSize: (fontSize) + "px",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -8,6 +8,8 @@ mediaMatch.addEventListener("change", async (event) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const isMobileDevice = window.matchMedia("(max-width: 600px)").matches
|
||||||
|
|
||||||
let autoUpdateCallbacks = null
|
let autoUpdateCallbacks = null
|
||||||
let currencyData = null
|
let currencyData = null
|
||||||
|
|
||||||
@ -74,6 +76,8 @@ if (settingsData !== null) {
|
|||||||
const Heynote = {
|
const Heynote = {
|
||||||
platform: platform,
|
platform: platform,
|
||||||
isWebApp: true,
|
isWebApp: true,
|
||||||
|
defaultFontFamily: "Hack",
|
||||||
|
defaultFontSize: isMobileDevice ? 16 : 12,
|
||||||
|
|
||||||
buffer: {
|
buffer: {
|
||||||
async load() {
|
async load() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user