-
Notifications
You must be signed in to change notification settings - Fork 2
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
Editor disabled #35
Editor disabled #35
Conversation
- Add concept to tinymce - requires addition of initalising in readonly - Add concept finshed to editor none - TODO: Codemirror
Actually this makes sense, also APIs should and must be enhanced to meet devs needs and as long as we’re not breaking anything we’re good. So, in sort go for it |
Thank you! |
The method makes sense but I’m actually modifying the codemirror instance itself. Fairly sure I should be making proxy methods at this point. But as If I can point to this comment in 6 months time it’s all good 😂 |
No worries, all the API naming is a complete rip off from the code mirror internals: /**
* getValue Type Function Should return the complete data from the editor
* Example: () => { return this.element.value; }
* setValue Type Function Should replace the complete data of the editor
* Example: (text) => { return this.element.value = text; }
* getSelection Type Function Should return the selected text from the editor
* Example: function () { return this.selectedText; }
* disable Type Function Toggles the editor into disabled mode. When the editor is
* active then everything should be usable. When inactive the
* editor should be unusable AND disabled for form validation
* Example: (bool) => { return this.disable = value; }
* replaceSelection Type Function Should replace the selected text of the editor
* If nothing selected, will insert the data at the cursor
* Example:
*/ What might be a little odd here is that all the other end points are named in the form of |
Adds ability to toggle editor from disabled mode and back again.
Codemirror is a bit grim here because we set the direct instance into the Joomla.editors stuff so i'm creating a new method in codemirror itself :/ (I know when @dgrammatiko sees this i'm going to be told off :D )
Fixes tags not showing when using html mode
There's still definitely some unwanted behaviour here - for example with the default editor function - the template data looks like:
This means that the html email is always showing as empty when your in html mode - to me this needs to take the same at least translated and master text as the main body (if not set to a different value in the email constructor)