1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-21 09:22:09 +03:00

Got alignment buttons barely working for paragraphs

This commit is contained in:
Dan Brown
2022-01-11 18:58:24 +00:00
parent 4e5153d372
commit 6744ab2ff9
5 changed files with 120 additions and 6 deletions

View File

@ -1,6 +1,6 @@
import {
MenuItem, Dropdown, DropdownSubmenu, renderGrouped, icons, joinUpItem, liftItem, selectParentNodeItem,
undoItem, redoItem, wrapItem, blockTypeItem
undoItem, redoItem, wrapItem, blockTypeItem, setAttrItem,
} from "./menu"
import {toggleMark} from "prosemirror-commands";
@ -102,12 +102,28 @@ const formats = [
], { label: 'Callouts' }),
];
const alignments = [
setAttrItem('align', 'left', {
label: 'Align Left'
}),
setAttrItem('align', 'right', {
label: 'Align Right'
}),
setAttrItem('align', 'center', {
label: 'Align Center'
}),
setAttrItem('align', 'justify', {
label: 'Align Justify'
}),
];
const menu = menuBar({
floating: false,
content: [
[undoItem, redoItem],
[new DropdownSubmenu(formats, { label: 'Formats' })],
inlineStyles,
alignments,
],
});