-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
When disableEditing: true, allow editing through medium toolbar? #1084
Comments
The |
What I ended up doing in my plugin, was toggling the attribute of the medium-editor from 'inherit' to 'true', executing the commands, and toggling back to 'inherit'. It's working ok. But I think it resets some of the settings, such as But this is all in the custom plugin, so it won't work for other buttons. I'll check out the |
What attribute of the medium-editor were you toggling? |
Umm, not of the Medium Editor per se, but of the 'div' the medium-editor was hooked to. Say I have this.base.origElements.setAttribute('contentEditable', 'true');
this.execAction(action, opts);
this.base.origElements.setAttribute('contentEditable', 'inherit'); When inspecting on the browser dev tools, the |
Interesting, good thinking as a workaround! If you wanted to follow a safer method for grabbing the editor element(s) within your plugin to make it handle more cases , I would recommend using getEditorElements(). So your code could look something like this: this.getEditorElements().forEach(function (element) {
element.setAttribute('contentEditable', 'true');
});
this.execAction(action, opts);
this.getEditorElements().forEach(function (element) {
element.setAttribute('contentEditable', 'inherit');
});
Thanks for sharing the workaround! |
Thanks for the feedback! Will make the changes as suggested. |
Is this feature available? Thanks. |
@abijr were you able to find it? |
Sorry guys, mistook the issue. |
Is this feature available ? |
Use case:
I want to prevent users from modifying the text, unless it is through the Medium toolbar.
e.g.:
Does medium-editor already have this feature? Is there a workaround if not? Should I submit a pull request?
The text was updated successfully, but these errors were encountered: