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

Feature: Disable image edit #231

Closed
zhaoyao91 opened this issue Mar 4, 2020 · 2 comments
Closed

Feature: Disable image edit #231

zhaoyao91 opened this issue Mar 4, 2020 · 2 comments
Labels
Milestone

Comments

@zhaoyao91
Copy link
Contributor

image

The image edit modal is too complex. How can I disable this button to prevent user being here?

@JiHong88 JiHong88 added this to the 2.27.0 milestone Mar 10, 2020
JiHong88 added a commit that referenced this issue Mar 16, 2020
core-currentControllerTarget
@JiHong88
Copy link
Owner

Hi @zhaoyao91

Added showController event.
You can use as below after version update.

const editor = subeditor.create(..);
editor.showController = function (name, controllers, core) {
    // target element
    console.log('target', core.currentControllerTarget);

    let c = null;
    for (let i in controllers) {
        c = controllers[i];
        if (core.util.hasClass(c, 'se-controller-resizing')) {
            const updateButton = c.querySelector('[data-command="update"]');
            if (name === 'image') updateButton.setAttribute('disabled', true);
            else updateButton.removeAttribute('disabled');
        }
    }
}

I'll notify you know when the version is updated.

@JiHong88
Copy link
Owner

The 2.27.0 version has been updated.
If there is an issue, please register as a new issue.
Thank you.

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

No branches or pull requests

2 participants