Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Being able to remove the table button from the WYSIWYG editor #1497

Closed
StevendeVries opened this issue Nov 11, 2020 · 1 comment
Closed

Being able to remove the table button from the WYSIWYG editor #1497

StevendeVries opened this issue Nov 11, 2020 · 1 comment

Comments

@StevendeVries
Copy link

With an extension you can easily change the button sets used in the WYSIWYG editor.
For example:

const { Component } = Shopware;

Component.override('sw-text-editor', {
    props: {
        buttonConfig: {
            type: Array,
            required: false,
            default() {
                return [
                    {
                        type: 'paragraph',
                        title: this.$tc('sw-text-editor-toolbar.title.format'),
                        icon: 'default-text-editor-style',
                        children: [
                            {
                                type: 'formatBlock',
                                name: this.$tc('sw-text-editor-toolbar.title.paragraph'),
                                value: 'p',
                                tag: 'p'
                            },
                       ]
                    },
                ];
            }
        }
    }
});   

However removing the table button isn't that straigthforward since it's not part of the default buttonConfig. When I look at this line and debug it it seems $options is never set making it hard to influence. See:
https://github.com/shopware/platform/blob/3473869ee32449ea74d6b11596ab7dc7bc28eb12/src/Administration/Resources/app/administration/src/app/component/form/sw-text-editor/index.js#L352

Could the table button be moved to the default buttonConfig?

@StevendeVries
Copy link
Author

Duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant