quill-blot-formatter icon indicating copy to clipboard operation
quill-blot-formatter copied to clipboard

How to hide align buttons from toolbar?

Open darshanDevrai opened this issue 6 years ago • 2 comments

When I align image from the main toolbar of quill then alignments remains in quill. While If I use the align buttons from quill-blot-formatter then alignments does not save in quill. If I dont user alignAction then resizer for video stops working.

So I just want to hide the three buttons of alignments from quill-blot-formatter. How to do that?

I am using this package in angular 7 along with ngx-quill.

darshanDevrai avatar Feb 22 '19 16:02 darshanDevrai

I created CustomImageSpec class that extends ImageSpec and I also delete AlignAction.

import { DeleteAction, ResizeAction, ImageSpec } from 'quill-blot-formatter'; export class CustomImageSpec extends ImageSpec { getActions() { return [DeleteAction, ResizeAction]; } }

and in your quill init add your CustomImageSpec to blotFormatter config.

this.quill = new Quill(... , { modules: { ... blotFormatter: { specs: CustomImageSpec } } });

gyfrxy-forever avatar Jul 31 '20 03:07 gyfrxy-forever

@gyfrxy-forever throwing a bug A Client Error Occured: TypeError: this.options.specs.map is not a function

to fix it pass the CustomImageSpec as array like this: this.quill = new Quill(... , { modules: { ... blotFormatter: { specs: [CustomImageSpec] } } });

and thanks for the workaround!

elazarza avatar Jun 03 '21 09:06 elazarza