{"action":"created","issue":{"url":"https://api.github.com/repos/froala/wysiwyg-editor/issues/2065","repository_url":"https://api.github.com/repos/froala/wysiwyg-editor","labels_url":"https://api.github.com/repos/froala/wysiwyg-editor/issues/2065/labels{/name}","comments_url":"https://api.github.com/repos/froala/wysiwyg-editor/issues/2065/comments","events_url":"https://api.github.com/repos/froala/wysiwyg-editor/issues/2065/events","html_url":"https://github.com/froala/wysiwyg-editor/issues/2065","id":238908180,"number":2065,"title":"Integration question, true initialization hook even with the `initOnClick` option","user":{"login":"Panman8201","id":3475765,"avatar_url":"https://avatars2.githubusercontent.com/u/3475765?v=4","gravatar_id":"","url":"https://api.github.com/users/Panman8201","html_url":"https://github.com/Panman8201","followers_url":"https://api.github.com/users/Panman8201/followers","following_url":"https://api.github.com/users/Panman8201/following{/other_user}","gists_url":"https://api.github.com/users/Panman8201/gists{/gist_id}","starred_url":"https://api.github.com/users/Panman8201/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Panman8201/subscriptions","organizations_url":"https://api.github.com/users/Panman8201/orgs","repos_url":"https://api.github.com/users/Panman8201/repos","events_url":"https://api.github.com/users/Panman8201/events{/privacy}","received_events_url":"https://api.github.com/users/Panman8201/received_events","type":"User","site_admin":false},"labels":[{"id":78343950,"url":"https://api.github.com/repos/froala/wysiwyg-editor/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-06-27T16:23:15Z","updated_at":"2017-08-14T16:59:17Z","closed_at":"2017-07-19T13:39:19Z","body":"I have an integration question/issue, the [ember-froala-editor plugin/addon](https://github.com/froala/ember-froala-editor/) does [additional (eventing) setup](https://github.com/froala/ember-froala-editor/blob/v2.6.2/addon/components/froala-editor.js#L347-L454) after the [initial `$('.selector').froalaEditor()` initialization call](https://github.com/froala/ember-froala-editor/blob/v2.6.2/addon/components/froala-editor.js#L295-L296). Currently this is done on a [`froalaEditor.initialized` event listener](https://github.com/froala/ember-froala-editor/blob/v2.6.2/addon/components/froala-editor.js#L285-L292) to gain access to the `editor` instance and to ensure the editor \"is ready\" (async). However, with the [`initOnClick` option](https://www.froala.com/wysiwyg-editor/docs/options#initOnClick), that hook is not called until, well, the editor is clicked (which is troublesome in this case). So what I need is a \"hook\" to run the additional setup code right after the initialization call and with access to the editor instance, no matter if the `initOnClick` option is used or not. Few questions/options;\r\n\r\n1. Is there another event that I can use for this setup task? It seems like `froalaEditor.init` works but want to confirm that this is *ok* to depend upon and that the editor \"is ready\" in this case.\r\n\r\n2. Is the `$('.selector').froalaEditor()` initialization call sync or async? In doing some research, [the](https://github.com/froala/react-froala-wysiwyg/blob/2.6.1/lib/FroalaEditorFunctionality.jsx#L76) [other](https://github.com/froala/angular2-froala-wysiwyg/blob/2.6.0/src/editor/editor.directive.ts#L197) [integration](https://github.com/froala/vue-froala-wysiwyg/blob/2.0.0/src/vue-froala.js#L100) [plugins](https://github.com/froala/knockout-froala/blob/2.6.1/src/knockout-froala.js#L69) [use](https://github.com/froala/angular-froala/blob/2.6.1/src/angular-froala.js#L122) a variation of the following for additional setup in sync mode. But is the editor truly ready in this case and is this an acceptable solution? `this.$element.froalaEditor(this.config).data('froala.editor').$el`\r\n\r\n3. Is there another option? Looking to brainstorm on solutions for this issue.\r\n\r\n** \"is ready\" = ok to call editor methods and such (interact with the editor instance)\r\n\r\nRelated Issue: froala/ember-froala-editor#40"},"comment":{"url":"https://api.github.com/repos/froala/wysiwyg-editor/issues/comments/322246648","html_url":"https://github.com/froala/wysiwyg-editor/issues/2065#issuecomment-322246648","issue_url":"https://api.github.com/repos/froala/wysiwyg-editor/issues/2065","id":322246648,"user":{"login":"kurdin","id":6027060,"avatar_url":"https://avatars2.githubusercontent.com/u/6027060?v=4","gravatar_id":"","url":"https://api.github.com/users/kurdin","html_url":"https://github.com/kurdin","followers_url":"https://api.github.com/users/kurdin/followers","following_url":"https://api.github.com/users/kurdin/following{/other_user}","gists_url":"https://api.github.com/users/kurdin/gists{/gist_id}","starred_url":"https://api.github.com/users/kurdin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kurdin/subscriptions","organizations_url":"https://api.github.com/users/kurdin/orgs","repos_url":"https://api.github.com/users/kurdin/repos","events_url":"https://api.github.com/users/kurdin/events{/privacy}","received_events_url":"https://api.github.com/users/kurdin/received_events","type":"User","site_admin":false},"created_at":"2017-08-14T16:59:17Z","updated_at":"2017-08-14T16:59:17Z","body":"@Panman8201 \r\nhmm, that is strange because other events I tried work fine with attachment on init element.\r\n\r\nI just tried this and it works as well\r\n````js\r\n$(function(){\r\n  $('#edit').froalaEditor({\r\n    toolbarInline: true,\r\n    initOnClick: true\r\n  }).on('froalaEditor.contentChanged', (e, editor) => {\r\n      alert('changed');\r\n  }).on('froalaEditor.initialized', (e, editor) => {\r\n     alert('initialized');\r\n });\r\n});\r\n````\r\nhttps://codepen.io/anon/pen/RZLQmo\r\n"}}
{"actor":{"display_login":"kurdin"}}