-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add option to configure editor as non-editable #1206
base: 9.x
Are you sure you want to change the base?
Conversation
feb0f59
to
1886d9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works correctly, seems like it takes some time to make it editable again, but I guess the use of this is not to make editable/not editable quickly
@@ -111,6 +116,9 @@ export default class RdfaEditor extends Component<RdfaEditorArgs> { | |||
nodeViews: this.args.nodeViews, | |||
defaultAttrGenerators: this.args.defaultAttrGenerators, | |||
keyMapOptions: this.args.keyMapOptions, | |||
editable: () => { | |||
return !(this.editable === false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can do !!this.editable I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in this case I think, as we do not want to trigger it when editable
is undefined
or null
, this is why we strictly compare it to false
.
890c6a8
to
8cd349e
Compare
I'm missing also the visual changes we do in GN (placeholders from yellow to grey, etc) I think we should try to make it as ootb as possible, requiring no extra css from embeddable users until they specifically ask for customization |
With that said, we might even want to hide the toolbar and sidebar as well with this toggle |
8cd349e
to
93d2eea
Compare
I'm not sure if that is the responsibility of this addon? As the user can configure themselves whether to show the sidebar and toolbar, essentially this addon does not have control over their visibility. We can however, control that visibility in the embeddable package. |
Agreed, will look into adapting the css. We might then also have to do some adaptions of the plugins css. |
yeah ok fair enough |
Overview
This PR adds an option to configure the editor as non-editable.
It can be configured in two ways:
Editor
component, by passing theeditable
argument. The editor will also correctly react to value changes of this argument.SayController
class, by executing thetoggleEditable
methodHow to test/reproduce
toggle editable
button. This button uses theEditor
component argument approachtoggleEditable
method of the editor controller should yield the same results.Challenges/uncertainties
Checks PR readiness