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