mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-05-08 03:37:28 +08:00
feat: show compact vditor toolbar on mobile
This commit is contained in:
@@ -235,7 +235,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.vditor-toolbar {
|
.vditor-toolbar {
|
||||||
display: none;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.about-content h1,
|
.about-content h1,
|
||||||
|
|||||||
@@ -38,6 +38,28 @@ export function createVditor(editorId, options = {}) {
|
|||||||
return searchUsers(value)
|
return searchUsers(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isMobile = window.innerWidth <= 768
|
||||||
|
const toolbar = isMobile
|
||||||
|
? ['emoji', 'bold', 'italic', 'strike', '|', 'link', 'upload']
|
||||||
|
: [
|
||||||
|
'emoji',
|
||||||
|
'bold',
|
||||||
|
'italic',
|
||||||
|
'strike',
|
||||||
|
'|',
|
||||||
|
'list',
|
||||||
|
'line',
|
||||||
|
'quote',
|
||||||
|
'code',
|
||||||
|
'inline-code',
|
||||||
|
'|',
|
||||||
|
'undo',
|
||||||
|
'redo',
|
||||||
|
'|',
|
||||||
|
'link',
|
||||||
|
'upload'
|
||||||
|
]
|
||||||
|
|
||||||
let vditor
|
let vditor
|
||||||
vditor = new Vditor(editorId, {
|
vditor = new Vditor(editorId, {
|
||||||
placeholder,
|
placeholder,
|
||||||
@@ -62,24 +84,7 @@ export function createVditor(editorId, options = {}) {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
cdn: 'https://openisle-1307107697.cos.ap-guangzhou.myqcloud.com/assert/vditor',
|
cdn: 'https://openisle-1307107697.cos.ap-guangzhou.myqcloud.com/assert/vditor',
|
||||||
toolbar: [
|
toolbar,
|
||||||
'emoji',
|
|
||||||
'bold',
|
|
||||||
'italic',
|
|
||||||
'strike',
|
|
||||||
'|',
|
|
||||||
'list',
|
|
||||||
'line',
|
|
||||||
'quote',
|
|
||||||
'code',
|
|
||||||
'inline-code',
|
|
||||||
'|',
|
|
||||||
'undo',
|
|
||||||
'redo',
|
|
||||||
'|',
|
|
||||||
'link',
|
|
||||||
'upload'
|
|
||||||
],
|
|
||||||
upload: {
|
upload: {
|
||||||
accept: 'image/*,video/*',
|
accept: 'image/*,video/*',
|
||||||
multiple: false,
|
multiple: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user