{"action":"created","issue":{"url":"https://api.github.com/repos/yabwe/medium-editor/issues/1009","repository_url":"https://api.github.com/repos/yabwe/medium-editor","labels_url":"https://api.github.com/repos/yabwe/medium-editor/issues/1009/labels{/name}","comments_url":"https://api.github.com/repos/yabwe/medium-editor/issues/1009/comments","events_url":"https://api.github.com/repos/yabwe/medium-editor/issues/1009/events","html_url":"https://github.com/yabwe/medium-editor/pull/1009","id":139997868,"number":1009,"title":"Added support for multiple instances of contenteditable areas on the …","user":{"login":"rvetere","id":1505976,"avatar_url":"https://avatars.githubusercontent.com/u/1505976?v=3","gravatar_id":"","url":"https://api.github.com/users/rvetere","html_url":"https://github.com/rvetere","followers_url":"https://api.github.com/users/rvetere/followers","following_url":"https://api.github.com/users/rvetere/following{/other_user}","gists_url":"https://api.github.com/users/rvetere/gists{/gist_id}","starred_url":"https://api.github.com/users/rvetere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvetere/subscriptions","organizations_url":"https://api.github.com/users/rvetere/orgs","repos_url":"https://api.github.com/users/rvetere/repos","events_url":"https://api.github.com/users/rvetere/events{/privacy}","received_events_url":"https://api.github.com/users/rvetere/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-10T20:18:15Z","updated_at":"2016-03-24T03:18:46Z","closed_at":"2016-03-10T23:22:37Z","pull_request":{"url":"https://api.github.com/repos/yabwe/medium-editor/pulls/1009","html_url":"https://github.com/yabwe/medium-editor/pull/1009","diff_url":"https://github.com/yabwe/medium-editor/pull/1009.diff","patch_url":"https://github.com/yabwe/medium-editor/pull/1009.patch"},"body":"…same page :) oh and just a new ignore for .iml - project files of intteliJ IDEA.\r\n\r\nI'm just starting a total rewrite from scratch of https://vp24.com - where i already implemented this awesome medium-editor clone more than a year ago. I've dirty hacked the source quite a bit back those days to implement much more things that where needed for vp24. things like color-picker, font-selection, alignments and more buttons leading back to basic functionality of our own editor.\r\n\r\nand first of all - the support to have more than one instance of a working content-editable area on the same page, and everything handled from one instance of MediumEditor.\r\n\r\nwell, maybe i was just too dumb back those days and i didn't see an existing solution in there to achieve that smoothly - or is really everybody else dealing just with one big-ass instance per page/state? ^^\r\n\r\nso, you can go ahead and tell me how that would be intended to achieve and we can forget this pull-request :D\r\n\r\ni've added two new functions:\r\n\r\n* addElements\r\n`this will add an array of new elements to this.elements, and re-run initElements`\r\n\r\n* cleanupElements\r\n`this one will run trough all this.elements and check if they still exists in the DOM - and simply filter them out`\r\n\r\nthen i've added a new if in \"initElements\", so i can check if an element is already initialized and skip it.\r\n\r\nafter that i'm ending up with a solution like this in my ng2 directive:\r\n\r\n`\r\n      if (!window.mediumEditor) {\r\n         window.mediumEditor = new MediumEditor(el.nativeElement, { ... });\r\n      } else {\r\n         window.mediumEditor.addElements(el.nativeElement);\r\n      }\r\n`\r\n\r\ni'm slowly starting trough with my new editor implementation - so i guess i will contribute more things to editor in the future - like i have should done way earlier but better now than never! ;)"},"comment":{"url":"https://api.github.com/repos/yabwe/medium-editor/issues/comments/200637529","html_url":"https://github.com/yabwe/medium-editor/pull/1009#issuecomment-200637529","issue_url":"https://api.github.com/repos/yabwe/medium-editor/issues/1009","id":200637529,"user":{"login":"nmielnik","id":2444240,"avatar_url":"https://avatars.githubusercontent.com/u/2444240?v=3","gravatar_id":"","url":"https://api.github.com/users/nmielnik","html_url":"https://github.com/nmielnik","followers_url":"https://api.github.com/users/nmielnik/followers","following_url":"https://api.github.com/users/nmielnik/following{/other_user}","gists_url":"https://api.github.com/users/nmielnik/gists{/gist_id}","starred_url":"https://api.github.com/users/nmielnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmielnik/subscriptions","organizations_url":"https://api.github.com/users/nmielnik/orgs","repos_url":"https://api.github.com/users/nmielnik/repos","events_url":"https://api.github.com/users/nmielnik/events{/privacy}","received_events_url":"https://api.github.com/users/nmielnik/received_events","type":"User","site_admin":false},"created_at":"2016-03-24T03:18:46Z","updated_at":"2016-03-24T03:18:46Z","body":"Awesome, sounds great, thanks @reveter!  Let us know if there's anything else we can answer or help with."}}