{"action":"created","comment":{"url":"https://api.github.com/repos/readium/readium-shared-js/pulls/comments/117626598","pull_request_review_id":39350938,"id":117626598,"diff_hunk":"@@ -1299,7 +1321,7 @@ var CfiNavigationLogic = function(options) {\n         _.each($elements, function ($node) {\n             var node = $node[0];\n             var isTextNode = (node.nodeType === Node.TEXT_NODE);\n-            var element = isTextNode ? node.parentElement : node;\n+            var element = isTextNode ? getParentElement(node) : node;","path":"js/views/cfi_navigation_logic.js","position":34,"original_position":34,"commit_id":"b33980d97c24d69be46c481572761d9bb38f6f9c","original_commit_id":"b33980d97c24d69be46c481572761d9bb38f6f9c","user":{"login":"danielweck","id":625201,"avatar_url":"https://avatars0.githubusercontent.com/u/625201?v=3","gravatar_id":"","url":"https://api.github.com/users/danielweck","html_url":"https://github.com/danielweck","followers_url":"https://api.github.com/users/danielweck/followers","following_url":"https://api.github.com/users/danielweck/following{/other_user}","gists_url":"https://api.github.com/users/danielweck/gists{/gist_id}","starred_url":"https://api.github.com/users/danielweck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielweck/subscriptions","organizations_url":"https://api.github.com/users/danielweck/orgs","repos_url":"https://api.github.com/users/danielweck/repos","events_url":"https://api.github.com/users/danielweck/events{/privacy}","received_events_url":"https://api.github.com/users/danielweck/received_events","type":"User","site_admin":false},"body":"There are other uses of `node.parentElement`, notably `plugins/highlights/manager.js` `getAnnotationMidpoints()`\r\nhttps://github.com/readium/readium-shared-js/blob/develop/plugins/highlights/manager.js#L304\r\nI also note the use of jQuery's `$node.parent()` in many places in ReadiumJS, notably:\r\n```javascript\r\n                //figure out a better way to get the html parent from an element..\r\n                var $html = $element.parent();\r\n```\r\nhttps://github.com/readium/readium-shared-js/blob/develop/plugins/highlights/manager.js#L322\r\n\r\n@JCCR ","created_at":"2017-05-21T08:35:53Z","updated_at":"2017-05-21T08:35:53Z","html_url":"https://github.com/readium/readium-shared-js/pull/387#discussion_r117626598","pull_request_url":"https://api.github.com/repos/readium/readium-shared-js/pulls/387","_links":{"self":{"href":"https://api.github.com/repos/readium/readium-shared-js/pulls/comments/117626598"},"html":{"href":"https://github.com/readium/readium-shared-js/pull/387#discussion_r117626598"},"pull_request":{"href":"https://api.github.com/repos/readium/readium-shared-js/pulls/387"}}},"pull_request":{"url":"https://api.github.com/repos/readium/readium-shared-js/pulls/387","id":120858764,"html_url":"https://github.com/readium/readium-shared-js/pull/387","diff_url":"https://github.com/readium/readium-shared-js/pull/387.diff","patch_url":"https://github.com/readium/readium-shared-js/pull/387.patch","issue_url":"https://api.github.com/repos/readium/readium-shared-js/issues/387","number":387,"state":"open","locked":false,"title":"Readium shared issue #386, added helper function for node.parentElement","user":{"login":"einarstubhaug","id":5663392,"avatar_url":"https://avatars1.githubusercontent.com/u/5663392?v=3","gravatar_id":"","url":"https://api.github.com/users/einarstubhaug","html_url":"https://github.com/einarstubhaug","followers_url":"https://api.github.com/users/einarstubhaug/followers","following_url":"https://api.github.com/users/einarstubhaug/following{/other_user}","gists_url":"https://api.github.com/users/einarstubhaug/gists{/gist_id}","starred_url":"https://api.github.com/users/einarstubhaug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/einarstubhaug/subscriptions","organizations_url":"https://api.github.com/users/einarstubhaug/orgs","repos_url":"https://api.github.com/users/einarstubhaug/repos","events_url":"https://api.github.com/users/einarstubhaug/events{/privacy}","received_events_url":"https://api.github.com/users/einarstubhaug/received_events","type":"User","site_admin":false},"body":"Because IE returns null for text nodes\r\n\r\n\r\n#### Related issue\r\nhttps://github.com/readium/readium-shared-js/issues/386\r\n\r\n### Additional information\r\nAdded function getParentElement which return node.parentElement if it is defined (chrome/firefox/safari/etc)  or searches for the closest element in internet explorer 10 & 11\r\n","created_at":"2017-05-16T15:35:26Z","updated_at":"2017-05-21T08:35:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3be7084f653030874b9fd1abbb6edf6789e23560","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/readium/readium-shared-js/pulls/387/commits","review_comments_url":"https://api.github.com/repos/readium/readium-shared-js/pulls/387/comments","review_comment_url":"https://api.github.com/repos/readium/readium-shared-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/readium/readium-shared-js/issues/387/comments","statuses_url":"https://api.github.com/repos/readium/readium-shared-js/statuses/b33980d97c24d69be46c481572761d9bb38f6f9c","head":{"label":"ravn-no:develop","ref":"develop","sha":"b33980d97c24d69be46c481572761d9bb38f6f9c","user":{"login":"ravn-no","id":7403536,"avatar_url":"https://avatars3.githubusercontent.com/u/7403536?v=3","gravatar_id":"","url":"https://api.github.com/users/ravn-no","html_url":"https://github.com/ravn-no","followers_url":"https://api.github.com/users/ravn-no/followers","following_url":"https://api.github.com/users/ravn-no/following{/other_user}","gists_url":"https://api.github.com/users/ravn-no/gists{/gist_id}","starred_url":"https://api.github.com/users/ravn-no/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ravn-no/subscriptions","organizations_url":"https://api.github.com/users/ravn-no/orgs","repos_url":"https://api.github.com/users/ravn-no/repos","events_url":"https://api.github.com/users/ravn-no/events{/privacy}","received_events_url":"https://api.github.com/users/ravn-no/received_events","type":"Organization","site_admin":false},"repo":{"id":21232176,"name":"readium-shared-js","full_name":"ravn-no/readium-shared-js","owner":{"login":"ravn-no","id":7403536,"avatar_url":"https://avatars3.githubusercontent.com/u/7403536?v=3","gravatar_id":"","url":"https://api.github.com/users/ravn-no","html_url":"https://github.com/ravn-no","followers_url":"https://api.github.com/users/ravn-no/followers","following_url":"https://api.github.com/users/ravn-no/following{/other_user}","gists_url":"https://api.github.com/users/ravn-no/gists{/gist_id}","starred_url":"https://api.github.com/users/ravn-no/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ravn-no/subscriptions","organizations_url":"https://api.github.com/users/ravn-no/orgs","repos_url":"https://api.github.com/users/ravn-no/repos","events_url":"https://api.github.com/users/ravn-no/events{/privacy}","received_events_url":"https://api.github.com/users/ravn-no/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ravn-no/readium-shared-js","description":"Repository for the shared JavaScript libraries that are used in the SDK-Launchers and other applications developed on top of the SDK","fork":true,"url":"https://api.github.com/repos/ravn-no/readium-shared-js","forks_url":"https://api.github.com/repos/ravn-no/readium-shared-js/forks","keys_url":"https://api.github.com/repos/ravn-no/readium-shared-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ravn-no/readium-shared-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ravn-no/readium-shared-js/teams","hooks_url":"https://api.github.com/repos/ravn-no/readium-shared-js/hooks","issue_events_url":"https://api.github.com/repos/ravn-no/readium-shared-js/issues/events{/number}","events_url":"https://api.github.com/repos/ravn-no/readium-shared-js/events","assignees_url":"https://api.github.com/repos/ravn-no/readium-shared-js/assignees{/user}","branches_url":"https://api.github.com/repos/ravn-no/readium-shared-js/branches{/branch}","tags_url":"https://api.github.com/repos/ravn-no/readium-shared-js/tags","blobs_url":"https://api.github.com/repos/ravn-no/readium-shared-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ravn-no/readium-shared-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ravn-no/readium-shared-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/ravn-no/readium-shared-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ravn-no/readium-shared-js/statuses/{sha}","languages_url":"https://api.github.com/repos/ravn-no/readium-shared-js/languages","stargazers_url":"https://api.github.com/repos/ravn-no/readium-shared-js/stargazers","contributors_url":"https://api.github.com/repos/ravn-no/readium-shared-js/contributors","subscribers_url":"https://api.github.com/repos/ravn-no/readium-shared-js/subscribers","subscription_url":"https://api.github.com/repos/ravn-no/readium-shared-js/subscription","commits_url":"https://api.github.com/repos/ravn-no/readium-shared-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/ravn-no/readium-shared-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/ravn-no/readium-shared-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/ravn-no/readium-shared-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/ravn-no/readium-shared-js/contents/{+path}","compare_url":"https://api.github.com/repos/ravn-no/readium-shared-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ravn-no/readium-shared-js/merges","archive_url":"https://api.github.com/repos/ravn-no/readium-shared-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ravn-no/readium-shared-js/downloads","issues_url":"https://api.github.com/repos/ravn-no/readium-shared-js/issues{/number}","pulls_url":"https://api.github.com/repos/ravn-no/readium-shared-js/pulls{/number}","milestones_url":"https://api.github.com/repos/ravn-no/readium-shared-js/milestones{/number}","notifications_url":"https://api.github.com/repos/ravn-no/readium-shared-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ravn-no/readium-shared-js/labels{/name}","releases_url":"https://api.github.com/repos/ravn-no/readium-shared-js/releases{/id}","deployments_url":"https://api.github.com/repos/ravn-no/readium-shared-js/deployments","created_at":"2014-06-26T07:37:37Z","updated_at":"2016-05-13T20:36:00Z","pushed_at":"2017-05-16T15:28:19Z","git_url":"git://github.com/ravn-no/readium-shared-js.git","ssh_url":"git@github.com:ravn-no/readium-shared-js.git","clone_url":"https://github.com/ravn-no/readium-shared-js.git","svn_url":"https://github.com/ravn-no/readium-shared-js","homepage":null,"size":30602,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"readium:develop","ref":"develop","sha":"5ba22949e3a2076abcea4238e469c88a86a0caaf","user":{"login":"readium","id":1402124,"avatar_url":"https://avatars0.githubusercontent.com/u/1402124?v=3","gravatar_id":"","url":"https://api.github.com/users/readium","html_url":"https://github.com/readium","followers_url":"https://api.github.com/users/readium/followers","following_url":"https://api.github.com/users/readium/following{/other_user}","gists_url":"https://api.github.com/users/readium/gists{/gist_id}","starred_url":"https://api.github.com/users/readium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/readium/subscriptions","organizations_url":"https://api.github.com/users/readium/orgs","repos_url":"https://api.github.com/users/readium/repos","events_url":"https://api.github.com/users/readium/events{/privacy}","received_events_url":"https://api.github.com/users/readium/received_events","type":"Organization","site_admin":false},"repo":{"id":11318369,"name":"readium-shared-js","full_name":"readium/readium-shared-js","owner":{"login":"readium","id":1402124,"avatar_url":"https://avatars0.githubusercontent.com/u/1402124?v=3","gravatar_id":"","url":"https://api.github.com/users/readium","html_url":"https://github.com/readium","followers_url":"https://api.github.com/users/readium/followers","following_url":"https://api.github.com/users/readium/following{/other_user}","gists_url":"https://api.github.com/users/readium/gists{/gist_id}","starred_url":"https://api.github.com/users/readium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/readium/subscriptions","organizations_url":"https://api.github.com/users/readium/orgs","repos_url":"https://api.github.com/users/readium/repos","events_url":"https://api.github.com/users/readium/events{/privacy}","received_events_url":"https://api.github.com/users/readium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/readium/readium-shared-js","description":"Repository for the shared JavaScript libraries that are used in the SDK-Launchers and other applications developed on top of the SDK","fork":false,"url":"https://api.github.com/repos/readium/readium-shared-js","forks_url":"https://api.github.com/repos/readium/readium-shared-js/forks","keys_url":"https://api.github.com/repos/readium/readium-shared-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/readium/readium-shared-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/readium/readium-shared-js/teams","hooks_url":"https://api.github.com/repos/readium/readium-shared-js/hooks","issue_events_url":"https://api.github.com/repos/readium/readium-shared-js/issues/events{/number}","events_url":"https://api.github.com/repos/readium/readium-shared-js/events","assignees_url":"https://api.github.com/repos/readium/readium-shared-js/assignees{/user}","branches_url":"https://api.github.com/repos/readium/readium-shared-js/branches{/branch}","tags_url":"https://api.github.com/repos/readium/readium-shared-js/tags","blobs_url":"https://api.github.com/repos/readium/readium-shared-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/readium/readium-shared-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/readium/readium-shared-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/readium/readium-shared-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/readium/readium-shared-js/statuses/{sha}","languages_url":"https://api.github.com/repos/readium/readium-shared-js/languages","stargazers_url":"https://api.github.com/repos/readium/readium-shared-js/stargazers","contributors_url":"https://api.github.com/repos/readium/readium-shared-js/contributors","subscribers_url":"https://api.github.com/repos/readium/readium-shared-js/subscribers","subscription_url":"https://api.github.com/repos/readium/readium-shared-js/subscription","commits_url":"https://api.github.com/repos/readium/readium-shared-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/readium/readium-shared-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/readium/readium-shared-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/readium/readium-shared-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/readium/readium-shared-js/contents/{+path}","compare_url":"https://api.github.com/repos/readium/readium-shared-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/readium/readium-shared-js/merges","archive_url":"https://api.github.com/repos/readium/readium-shared-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/readium/readium-shared-js/downloads","issues_url":"https://api.github.com/repos/readium/readium-shared-js/issues{/number}","pulls_url":"https://api.github.com/repos/readium/readium-shared-js/pulls{/number}","milestones_url":"https://api.github.com/repos/readium/readium-shared-js/milestones{/number}","notifications_url":"https://api.github.com/repos/readium/readium-shared-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/readium/readium-shared-js/labels{/name}","releases_url":"https://api.github.com/repos/readium/readium-shared-js/releases{/id}","deployments_url":"https://api.github.com/repos/readium/readium-shared-js/deployments","created_at":"2013-07-10T17:09:38Z","updated_at":"2017-02-25T04:32:07Z","pushed_at":"2017-05-19T06:19:06Z","git_url":"git://github.com/readium/readium-shared-js.git","ssh_url":"git@github.com:readium/readium-shared-js.git","clone_url":"https://github.com/readium/readium-shared-js.git","svn_url":"https://github.com/readium/readium-shared-js","homepage":null,"size":33205,"stargazers_count":49,"watchers_count":49,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":83,"mirror_url":null,"open_issues_count":162,"forks":83,"open_issues":162,"watchers":49,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/readium/readium-shared-js/pulls/387"},"html":{"href":"https://github.com/readium/readium-shared-js/pull/387"},"issue":{"href":"https://api.github.com/repos/readium/readium-shared-js/issues/387"},"comments":{"href":"https://api.github.com/repos/readium/readium-shared-js/issues/387/comments"},"review_comments":{"href":"https://api.github.com/repos/readium/readium-shared-js/pulls/387/comments"},"review_comment":{"href":"https://api.github.com/repos/readium/readium-shared-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/readium/readium-shared-js/pulls/387/commits"},"statuses":{"href":"https://api.github.com/repos/readium/readium-shared-js/statuses/b33980d97c24d69be46c481572761d9bb38f6f9c"}}}}
{"actor":{"display_login":"danielweck"}}