{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/ui-tinymce/issues/249","repository_url":"https://api.github.com/repos/angular-ui/ui-tinymce","labels_url":"https://api.github.com/repos/angular-ui/ui-tinymce/issues/249/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-tinymce/issues/249/comments","events_url":"https://api.github.com/repos/angular-ui/ui-tinymce/issues/249/events","html_url":"https://github.com/angular-ui/ui-tinymce/issues/249","id":151683564,"number":249,"title":"TinyMCE gets cleared when dragged inside a repeater","user":{"login":"CSchuster","id":2861657,"avatar_url":"https://avatars.githubusercontent.com/u/2861657?v=3","gravatar_id":"","url":"https://api.github.com/users/CSchuster","html_url":"https://github.com/CSchuster","followers_url":"https://api.github.com/users/CSchuster/followers","following_url":"https://api.github.com/users/CSchuster/following{/other_user}","gists_url":"https://api.github.com/users/CSchuster/gists{/gist_id}","starred_url":"https://api.github.com/users/CSchuster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CSchuster/subscriptions","organizations_url":"https://api.github.com/users/CSchuster/orgs","repos_url":"https://api.github.com/users/CSchuster/repos","events_url":"https://api.github.com/users/CSchuster/events{/privacy}","received_events_url":"https://api.github.com/users/CSchuster/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-04-28T16:14:27Z","updated_at":"2016-04-29T13:23:32Z","closed_at":"2016-04-28T20:22:37Z","body":"Hi,\r\n\r\ni use the TinyMCE in an AngularJS repeater with the ng-sortable v1.3.5.\r\n\r\nBut unfortunately the Editor gets cleared everytime i move him.\r\n\r\nThe Model still has the connect Values and even the underlying textarea is still ok:\r\n\r\n```\r\n <ul as-sortable=\"dragControlListeners\" ng-model=\"items\">\r\n\t<li ng-repeat=\"item in items\" as-sortable-item>\r\n\t\t<div class=\"col-md-1\" as-sortable-item-handle>DRAG</div>\r\n\t\t\t<div class=\"col-sm-8\">\r\n\t\t\t\t<textarea ui-tinymce=\"tinymceOptions\" ng-model=\"item.abstract\"></textarea>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</li>\r\n</ul>\r\n```\r\n\r\nAny ideas how to keep the TinyMCE Editor filled after drag/drop?\r\n\r\nkind regards\r\nChristoph"},"comment":{"url":"https://api.github.com/repos/angular-ui/ui-tinymce/issues/comments/215709700","html_url":"https://github.com/angular-ui/ui-tinymce/issues/249#issuecomment-215709700","issue_url":"https://api.github.com/repos/angular-ui/ui-tinymce/issues/249","id":215709700,"user":{"login":"CSchuster","id":2861657,"avatar_url":"https://avatars.githubusercontent.com/u/2861657?v=3","gravatar_id":"","url":"https://api.github.com/users/CSchuster","html_url":"https://github.com/CSchuster","followers_url":"https://api.github.com/users/CSchuster/followers","following_url":"https://api.github.com/users/CSchuster/following{/other_user}","gists_url":"https://api.github.com/users/CSchuster/gists{/gist_id}","starred_url":"https://api.github.com/users/CSchuster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CSchuster/subscriptions","organizations_url":"https://api.github.com/users/CSchuster/orgs","repos_url":"https://api.github.com/users/CSchuster/repos","events_url":"https://api.github.com/users/CSchuster/events{/privacy}","received_events_url":"https://api.github.com/users/CSchuster/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T13:23:32Z","updated_at":"2016-04-29T13:23:32Z","body":"Hi,\r\n\r\ni fixed the flickering by keeping the heights with this:\r\n\r\n```\r\nscope.$on('$tinymce:refresh', function (e, id) {\r\n\tvar eid = attrs.id;\r\n\tif (angular.isUndefined(id) || id === eid) {\r\n\r\n\t\tvar parentElement = element.parent();\r\n\t\tvar clonedElement = element.clone();\r\n\r\n\t\tclonedElement.removeAttr('id');\r\n\t\tclonedElement.removeAttr('style');\r\n\t\tclonedElement.removeAttr('aria-hidden');\r\n\r\n\t\t//--Store old Parent Height\r\n\t\tvar oldParentHeight = jQuery(parentElement).height();\r\n\t\tjQuery(parentElement).css(\"height\", oldParentHeight);\r\n\r\n\t\t//--Store old iFrame Height\r\n\t\tvar oldiFrameHeight = jQuery(\"iframe\", parentElement).height();\r\n\r\n\t\t//--Remove old TinyMCE\r\n\t\ttinymce.execCommand('mceRemoveEditor', false, eid);\r\n\t\tparentElement.append($compile(clonedElement)(scope));\r\n\r\n\t\t//-Set old Height to new iFrame\r\n\t\twindow.setTimeout(function () {\r\n\t\tjQuery(\"iframe\", parentElement).height(oldiFrameHeight);\r\n\t\tjQuery(parentElement).removeAttr(\"style\");\r\n\t\t}, 20);\r\n\r\n\t}\r\n});\r\n```\r\n\r\nbut it's still not working in Firefox :-("}}