-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
How text can be appended in the current pointer position? #111
Comments
Sorry, not sure if I totally get what do you want to build, for tags, you mean replaceable variables (inside text components)? In that case, I'd simply do what you already suggested, appending text at the selected position |
The editable component is inside the canvas (which is inside the iframe) so you have to access its document before executing commands var canvasDoc = editor.Canvas.getBody().ownerDocument;
// Insert text at the current pointer position
canvasDoc.execCommand("insertText", false, 'TEST'); |
How to persist the data after reload, after execCommand insert? |
Hi @artf, Am trying to insert a text cum link (from custom dropdwon in styleManager) and am using this code
Its adding the content in bottom of the editor instead of adding next to cursor pointer. Will you please help me out of this. |
Help me out of this @artf |
Hello,
I'm trying to build simple tags modal. All's fine there, I've created the modal, populated it with the tags ([FirstName], [LastName] etc.) but I want to attach .click() event to each tag so when someone clicks on it the tag will be appended to the current pointer position. I've tried to add it as a button in the RTE menu but then I realized they work only with commands. Creating a custom block isn't option too because I can't move it inside text section. So what should be the way of doing that? Simply appending text at the selected position in the text element.
The text was updated successfully, but these errors were encountered: