{"action":"created","issue":{"url":"https://api.github.com/repos/artf/grapesjs/issues/111","repository_url":"https://api.github.com/repos/artf/grapesjs","labels_url":"https://api.github.com/repos/artf/grapesjs/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/artf/grapesjs/issues/111/comments","events_url":"https://api.github.com/repos/artf/grapesjs/issues/111/events","html_url":"https://github.com/artf/grapesjs/issues/111","id":237116615,"number":111,"title":"How text can be appended in the current pointer position?","user":{"login":"vankyy26","id":10697327,"avatar_url":"https://avatars3.githubusercontent.com/u/10697327?v=3","gravatar_id":"","url":"https://api.github.com/users/vankyy26","html_url":"https://github.com/vankyy26","followers_url":"https://api.github.com/users/vankyy26/followers","following_url":"https://api.github.com/users/vankyy26/following{/other_user}","gists_url":"https://api.github.com/users/vankyy26/gists{/gist_id}","starred_url":"https://api.github.com/users/vankyy26/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vankyy26/subscriptions","organizations_url":"https://api.github.com/users/vankyy26/orgs","repos_url":"https://api.github.com/users/vankyy26/repos","events_url":"https://api.github.com/users/vankyy26/events{/privacy}","received_events_url":"https://api.github.com/users/vankyy26/received_events","type":"User","site_admin":false},"labels":[{"id":314854613,"url":"https://api.github.com/repos/artf/grapesjs/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-20T07:28:43Z","updated_at":"2017-06-21T12:09:44Z","closed_at":"2017-06-21T12:09:44Z","body":"Hello,\r\nI'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."},"comment":{"url":"https://api.github.com/repos/artf/grapesjs/issues/comments/310059057","html_url":"https://github.com/artf/grapesjs/issues/111#issuecomment-310059057","issue_url":"https://api.github.com/repos/artf/grapesjs/issues/111","id":310059057,"user":{"login":"artf","id":11614725,"avatar_url":"https://avatars3.githubusercontent.com/u/11614725?v=3","gravatar_id":"","url":"https://api.github.com/users/artf","html_url":"https://github.com/artf","followers_url":"https://api.github.com/users/artf/followers","following_url":"https://api.github.com/users/artf/following{/other_user}","gists_url":"https://api.github.com/users/artf/gists{/gist_id}","starred_url":"https://api.github.com/users/artf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artf/subscriptions","organizations_url":"https://api.github.com/users/artf/orgs","repos_url":"https://api.github.com/users/artf/repos","events_url":"https://api.github.com/users/artf/events{/privacy}","received_events_url":"https://api.github.com/users/artf/received_events","type":"User","site_admin":false},"created_at":"2017-06-21T12:09:44Z","updated_at":"2017-06-21T12:09:44Z","body":"The editable component is inside the canvas (which is inside the iframe) so you have to access its document before executing commands\r\n```js\r\nvar canvasDoc = editor.Canvas.getBody().ownerDocument;\r\n// Insert text at the current pointer position\r\ncanvasDoc.execCommand(\"insertText\", false, 'TEST');\r\n```"}}
{"actor":{"display_login":"artf"}}