{"action":"created","issue":{"url":"https://api.github.com/repos/fraywing/textAngular/issues/601","labels_url":"https://api.github.com/repos/fraywing/textAngular/issues/601/labels{/name}","comments_url":"https://api.github.com/repos/fraywing/textAngular/issues/601/comments","events_url":"https://api.github.com/repos/fraywing/textAngular/issues/601/events","html_url":"https://github.com/fraywing/textAngular/pull/601","id":64764995,"number":601,"title":"Remove call to rangy.init()","user":{"login":"iainbeeston","id":111963,"avatar_url":"https://avatars.githubusercontent.com/u/111963?v=3","gravatar_id":"","url":"https://api.github.com/users/iainbeeston","html_url":"https://github.com/iainbeeston","followers_url":"https://api.github.com/users/iainbeeston/followers","following_url":"https://api.github.com/users/iainbeeston/following{/other_user}","gists_url":"https://api.github.com/users/iainbeeston/gists{/gist_id}","starred_url":"https://api.github.com/users/iainbeeston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iainbeeston/subscriptions","organizations_url":"https://api.github.com/users/iainbeeston/orgs","repos_url":"https://api.github.com/users/iainbeeston/repos","events_url":"https://api.github.com/users/iainbeeston/events{/privacy}","received_events_url":"https://api.github.com/users/iainbeeston/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-03-27T13:46:33Z","updated_at":"2015-04-15T09:33:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fraywing/textAngular/pulls/601","html_url":"https://github.com/fraywing/textAngular/pull/601","diff_url":"https://github.com/fraywing/textAngular/pull/601.diff","patch_url":"https://github.com/fraywing/textAngular/pull/601.patch"},"body":"On firefox, if I have a page that loads textAngular, but textAngular is\r\nnot used at all (or if I load a textAngular element dynamically after\r\npage load), rangy.init() fails. This prevents rangy from ever\r\ninitializing, which cripples textAngular.\r\n\r\nHere's the stacktrace (shortened slightly):\r\n\r\n    \"Init listener threw an exception. Continuing.\" TypeError: sel is null\r\n    Stack trace:\r\n    @http://localhost:5000/assets/rangy/rangy-core.js?body=1:2533:13\r\n    @http://localhost:5000/assets/rangy/rangy-core.js?body=1:2513:10\r\n    window.rangy</api.createModule/<@http://localhost:5000/assets/rangy/rangy-core.js?body=1:236:13\r\n    init@http://localhost:5000/assets/rangy/rangy-core.js?body=1:167:17\r\n    @http://localhost:5000/assets/textAngular/textAngular.js?body=1:1833:3\r\n\r\nInterestingly, rangy.init() is only called to test that\r\nrangy.saveSelection is loaded. This is unnecessary - rangy initializes\r\nsaveSelection when it loads, and removing the call to rangy.init() does\r\nnot affect the check for saveSelection (so far as I can tell).\r\nFurthermore, textAngular 1.2.x never called rangy.init(), but instead relied on\r\nrangy to initialize itself.\r\n\r\nTo fix the bug I've removed the rangy.init() call. This means we can't\r\neasily check if the SaveSelection module is loaded, but I think it's\r\nfair to assume that if some has read enough of the readme to install\r\nrangy, they'll also have read enough to install SaveSelection."},"comment":{"url":"https://api.github.com/repos/fraywing/textAngular/issues/comments/93282741","html_url":"https://github.com/fraywing/textAngular/pull/601#issuecomment-93282741","issue_url":"https://api.github.com/repos/fraywing/textAngular/issues/601","id":93282741,"user":{"login":"iainbeeston","id":111963,"avatar_url":"https://avatars.githubusercontent.com/u/111963?v=3","gravatar_id":"","url":"https://api.github.com/users/iainbeeston","html_url":"https://github.com/iainbeeston","followers_url":"https://api.github.com/users/iainbeeston/followers","following_url":"https://api.github.com/users/iainbeeston/following{/other_user}","gists_url":"https://api.github.com/users/iainbeeston/gists{/gist_id}","starred_url":"https://api.github.com/users/iainbeeston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iainbeeston/subscriptions","organizations_url":"https://api.github.com/users/iainbeeston/orgs","repos_url":"https://api.github.com/users/iainbeeston/repos","events_url":"https://api.github.com/users/iainbeeston/events{/privacy}","received_events_url":"https://api.github.com/users/iainbeeston/received_events","type":"User","site_admin":false},"created_at":"2015-04-15T09:33:54Z","updated_at":"2015-04-15T09:33:54Z","body":"Is there any chance of getting this resolved? At present I'm stuck on angular 1.2 and textAngular 1.2 because of this issue (textAngular 1.2.2 doesn't have the issue, but it also doesn't allow angular 1.3 in it's bower.json)"}}