Skip to content

Commit

Permalink
feat(block-editor: Add justify button for text (#26601)
Browse files Browse the repository at this point in the history
Co-authored-by: Freddy Montes <[email protected]>
  • Loading branch information
zJaaal and fmontes authored Nov 7, 2023
1 parent 0005129 commit 56d7271
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export class DotBubbleMenuPluginView extends BubbleMenuView {
updateComponent() {
const { items } = this.component.instance;
const { activeItem } = this.getActiveNode();
const activeMarks = this.getActiveMarks(['left', 'center', 'right']);
const activeMarks = this.getActiveMarks(['justify', 'left', 'center', 'right']);

// Update
this.component.instance.selected = activeItem?.label;
Expand Down Expand Up @@ -340,6 +340,10 @@ export class DotBubbleMenuPluginView extends BubbleMenuView {
this.editor.commands.toggleUnderline();
break;

case 'justify':
this.toggleTextAlign(action, active);
break;

case 'left':
this.toggleTextAlign(action, active);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ const textMarks: Array<BubbleMenuItem> = [
];

const alignmentMarks: Array<BubbleMenuItem> = [
{
icon: 'format_align_justify',
markAction: 'justify',
active: false
},
{
icon: 'format_align_left',
markAction: 'left',
Expand Down
2 changes: 1 addition & 1 deletion dotCMS/src/main/webapp/html/dotcms-block-editor.js

Large diffs are not rendered by default.

0 comments on commit 56d7271

Please sign in to comment.