{"action":"created","comment":{"url":"https://api.github.com/repos/Courseography/courseography/pulls/comments/63873537","id":63873537,"diff_hunk":"@@ -261,28 +261,73 @@ var Graph = React.createClass({\n     },\n \n     nodeMouseEnter: function (event) {\n-        var courseID = event.currentTarget.id;\n-        var currentNode = this.refs.nodes.refs[courseID];\n+        var courseId = event.currentTarget.id;\n+        var currentNode = this.refs.nodes.refs[courseId];\n         currentNode.focusPrereqs(this);\n-\n-        // Old hover modal code\n-        if ($('.modal').length === 0) {\n-            $('.tooltip-group').remove();\n-            tooltip.displayTooltip(courseID);\n-        }\n+\t\t\t\t\n+        clearAllTimeouts();\n+\t\t\t\n+\t\t\t\tvar infoBox = this.refs.infobox;\n+\t\t\t\t//TODO: adjust xPos and yPos\n+\t\t\t\tvar xPos = currentNode.props.JSON.pos[0];\n+\t\t\t\tvar yPos = currentNode.props.JSON.pos[1];\n+\t\t\t\tvar rightSide = xPos > 222;\n+\t\t\t\t// The tooltip is offset with a 'padding' of 5.\n+\t\t\t\tif (rightSide) {\n+\t\t\t\t\t\txPos = parseFloat(xPos) - 65;\n+\t\t\t\t} else {\n+\t\t\t\t\t\txPos = parseFloat(xPos) +\n+\t\t\t\t\t\t\t\tparseFloat(currentNode.props.JSON.width) + 5;\n+\t\t\t\t}\n+\n+\t\t\t\tyPos = parseFloat(yPos);\n+\t\t\t\t\n+\t\t\t\tinfoBox.setState({xPos: xPos,\n+\t\t\t\t\t\t\t\t\t\t\t\t\tyPos: yPos,\n+\t\t\t\t\t\t\t\t\t\t\t\t\tnodeId: courseId,\n+\t\t\t\t\t\t\t\t\t\t\t\t \tshowInfobox: true});\n     },\n \n     nodeMouseLeave: function (event) {\n-        var courseID = event.currentTarget.id;\n-        var currentNode = this.refs.nodes.refs[courseID];\n+        var courseId = event.currentTarget.id;\n+        var currentNode = this.refs.nodes.refs[courseId];\n         currentNode.unfocusPrereqs(this);\n-\n-        // Old hover modal code\n-        if ($('.modal').length === 0) {\n-            tooltip.removeTooltip(this);\n-        }\n+\t\t\t\t\n+\t\t\t\tvar infoBox = this.refs.infobox;\n+\t\t\t\t\n+\t\t\t\tvar timeout = setTimeout(function () {\n+\t\t\t\t\t\tinfoBox.setState({showInfobox: false});\n+\t\t\t\t}, 400);\n+\n+\t\t\t\ttimeouts.push(timeout);\n+\t\t\t\n     },\n-\n+    \n+    infoBoxMouseEnter: function (event) {\n+        clearAllTimeouts();\n+\t\t\t\n+\t\t\t\tvar infoBox = this.refs.infobox;\n+        infoBox.setState({showInfobox: true});\n+    },\n+    \n+    infoBoxMouseLeave: function (event) {\n+        var infoBox = this.refs.infobox;\n+\t\t\t\t\n+\t\t\t\tvar timeout = setTimeout(function () {\n+\t\t\t\t\t\tinfoBox.setState({showInfobox: false});\n+\t\t\t\t}, 400);\n+\n+\t\t\t\ttimeouts.push(timeout);\n+    },\n+    \n+    infoBoxMouseClick: function (event) {","path":"public/js/graph/react_graph.js","position":90,"original_position":90,"commit_id":"406af285e17bb1e5cd4623b9ef2ce8d1fb62d47d","original_commit_id":"406af285e17bb1e5cd4623b9ef2ce8d1fb62d47d","user":{"login":"david-yz-liu","id":3333115,"avatar_url":"https://avatars.githubusercontent.com/u/3333115?v=3","gravatar_id":"","url":"https://api.github.com/users/david-yz-liu","html_url":"https://github.com/david-yz-liu","followers_url":"https://api.github.com/users/david-yz-liu/followers","following_url":"https://api.github.com/users/david-yz-liu/following{/other_user}","gists_url":"https://api.github.com/users/david-yz-liu/gists{/gist_id}","starred_url":"https://api.github.com/users/david-yz-liu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-yz-liu/subscriptions","organizations_url":"https://api.github.com/users/david-yz-liu/orgs","repos_url":"https://api.github.com/users/david-yz-liu/repos","events_url":"https://api.github.com/users/david-yz-liu/events{/privacy}","received_events_url":"https://api.github.com/users/david-yz-liu/received_events","type":"User","site_admin":false},"body":"Seems like this function doesn't need the `event` parameter. ","created_at":"2016-05-19T13:03:47Z","updated_at":"2016-05-19T13:03:47Z","html_url":"https://github.com/Courseography/courseography/pull/829#discussion_r63873537","pull_request_url":"https://api.github.com/repos/Courseography/courseography/pulls/829","_links":{"self":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/comments/63873537"},"html":{"href":"https://github.com/Courseography/courseography/pull/829#discussion_r63873537"},"pull_request":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/829"}}},"pull_request":{"url":"https://api.github.com/repos/Courseography/courseography/pulls/829","id":69603220,"html_url":"https://github.com/Courseography/courseography/pull/829","diff_url":"https://github.com/Courseography/courseography/pull/829.diff","patch_url":"https://github.com/Courseography/courseography/pull/829.patch","issue_url":"https://api.github.com/repos/Courseography/courseography/issues/829","number":829,"state":"open","locked":false,"title":"react-modal: Changing the infoBox and modal to React [WIP]","user":{"login":"ryanfan","id":3655302,"avatar_url":"https://avatars.githubusercontent.com/u/3655302?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanfan","html_url":"https://github.com/ryanfan","followers_url":"https://api.github.com/users/ryanfan/followers","following_url":"https://api.github.com/users/ryanfan/following{/other_user}","gists_url":"https://api.github.com/users/ryanfan/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanfan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanfan/subscriptions","organizations_url":"https://api.github.com/users/ryanfan/orgs","repos_url":"https://api.github.com/users/ryanfan/repos","events_url":"https://api.github.com/users/ryanfan/events{/privacy}","received_events_url":"https://api.github.com/users/ryanfan/received_events","type":"User","site_admin":false},"body":"I will look at changing the infoBox and modal into React for the next while.  A lot of the code for determining x,y coordinates is from the old code.\r\n\r\nTODOs include:\r\n- [x] Fixing the delay in the appearing and disappearing of infoBox\r\n- [ ] The popup modal should be in React\r\n- [ ] Take previously written `ModalDescription` and place in new modal\r\n","created_at":"2016-05-11T01:33:52Z","updated_at":"2016-05-19T13:03:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c33c72cabe91a8492d5684d458dc6df744fc26ce","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Courseography/courseography/pulls/829/commits","review_comments_url":"https://api.github.com/repos/Courseography/courseography/pulls/829/comments","review_comment_url":"https://api.github.com/repos/Courseography/courseography/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Courseography/courseography/issues/829/comments","statuses_url":"https://api.github.com/repos/Courseography/courseography/statuses/406af285e17bb1e5cd4623b9ef2ce8d1fb62d47d","head":{"label":"ryanfan:react-modal","ref":"react-modal","sha":"406af285e17bb1e5cd4623b9ef2ce8d1fb62d47d","user":{"login":"ryanfan","id":3655302,"avatar_url":"https://avatars.githubusercontent.com/u/3655302?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanfan","html_url":"https://github.com/ryanfan","followers_url":"https://api.github.com/users/ryanfan/followers","following_url":"https://api.github.com/users/ryanfan/following{/other_user}","gists_url":"https://api.github.com/users/ryanfan/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanfan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanfan/subscriptions","organizations_url":"https://api.github.com/users/ryanfan/orgs","repos_url":"https://api.github.com/users/ryanfan/repos","events_url":"https://api.github.com/users/ryanfan/events{/privacy}","received_events_url":"https://api.github.com/users/ryanfan/received_events","type":"User","site_admin":false},"repo":{"id":42494714,"name":"courseography","full_name":"ryanfan/courseography","owner":{"login":"ryanfan","id":3655302,"avatar_url":"https://avatars.githubusercontent.com/u/3655302?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanfan","html_url":"https://github.com/ryanfan","followers_url":"https://api.github.com/users/ryanfan/followers","following_url":"https://api.github.com/users/ryanfan/following{/other_user}","gists_url":"https://api.github.com/users/ryanfan/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanfan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanfan/subscriptions","organizations_url":"https://api.github.com/users/ryanfan/orgs","repos_url":"https://api.github.com/users/ryanfan/repos","events_url":"https://api.github.com/users/ryanfan/events{/privacy}","received_events_url":"https://api.github.com/users/ryanfan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ryanfan/courseography","description":"Courseography is a tool created by David Liu and Ian Stewart-Binks to guide students through their undergraduate careers.","fork":true,"url":"https://api.github.com/repos/ryanfan/courseography","forks_url":"https://api.github.com/repos/ryanfan/courseography/forks","keys_url":"https://api.github.com/repos/ryanfan/courseography/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ryanfan/courseography/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ryanfan/courseography/teams","hooks_url":"https://api.github.com/repos/ryanfan/courseography/hooks","issue_events_url":"https://api.github.com/repos/ryanfan/courseography/issues/events{/number}","events_url":"https://api.github.com/repos/ryanfan/courseography/events","assignees_url":"https://api.github.com/repos/ryanfan/courseography/assignees{/user}","branches_url":"https://api.github.com/repos/ryanfan/courseography/branches{/branch}","tags_url":"https://api.github.com/repos/ryanfan/courseography/tags","blobs_url":"https://api.github.com/repos/ryanfan/courseography/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ryanfan/courseography/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ryanfan/courseography/git/refs{/sha}","trees_url":"https://api.github.com/repos/ryanfan/courseography/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ryanfan/courseography/statuses/{sha}","languages_url":"https://api.github.com/repos/ryanfan/courseography/languages","stargazers_url":"https://api.github.com/repos/ryanfan/courseography/stargazers","contributors_url":"https://api.github.com/repos/ryanfan/courseography/contributors","subscribers_url":"https://api.github.com/repos/ryanfan/courseography/subscribers","subscription_url":"https://api.github.com/repos/ryanfan/courseography/subscription","commits_url":"https://api.github.com/repos/ryanfan/courseography/commits{/sha}","git_commits_url":"https://api.github.com/repos/ryanfan/courseography/git/commits{/sha}","comments_url":"https://api.github.com/repos/ryanfan/courseography/comments{/number}","issue_comment_url":"https://api.github.com/repos/ryanfan/courseography/issues/comments{/number}","contents_url":"https://api.github.com/repos/ryanfan/courseography/contents/{+path}","compare_url":"https://api.github.com/repos/ryanfan/courseography/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ryanfan/courseography/merges","archive_url":"https://api.github.com/repos/ryanfan/courseography/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ryanfan/courseography/downloads","issues_url":"https://api.github.com/repos/ryanfan/courseography/issues{/number}","pulls_url":"https://api.github.com/repos/ryanfan/courseography/pulls{/number}","milestones_url":"https://api.github.com/repos/ryanfan/courseography/milestones{/number}","notifications_url":"https://api.github.com/repos/ryanfan/courseography/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ryanfan/courseography/labels{/name}","releases_url":"https://api.github.com/repos/ryanfan/courseography/releases{/id}","deployments_url":"https://api.github.com/repos/ryanfan/courseography/deployments","created_at":"2015-09-15T04:15:37Z","updated_at":"2016-05-05T14:47:53Z","pushed_at":"2016-05-18T14:12:37Z","git_url":"git://github.com/ryanfan/courseography.git","ssh_url":"git@github.com:ryanfan/courseography.git","clone_url":"https://github.com/ryanfan/courseography.git","svn_url":"https://github.com/ryanfan/courseography","homepage":"","size":59253,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":false,"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":0,"default_branch":"master"}},"base":{"label":"Courseography:master","ref":"master","sha":"59a942f29ea6770a803499799201d7a150a1fb4d","user":{"login":"Courseography","id":9721671,"avatar_url":"https://avatars.githubusercontent.com/u/9721671?v=3","gravatar_id":"","url":"https://api.github.com/users/Courseography","html_url":"https://github.com/Courseography","followers_url":"https://api.github.com/users/Courseography/followers","following_url":"https://api.github.com/users/Courseography/following{/other_user}","gists_url":"https://api.github.com/users/Courseography/gists{/gist_id}","starred_url":"https://api.github.com/users/Courseography/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Courseography/subscriptions","organizations_url":"https://api.github.com/users/Courseography/orgs","repos_url":"https://api.github.com/users/Courseography/repos","events_url":"https://api.github.com/users/Courseography/events{/privacy}","received_events_url":"https://api.github.com/users/Courseography/received_events","type":"Organization","site_admin":false},"repo":{"id":16873349,"name":"courseography","full_name":"Courseography/courseography","owner":{"login":"Courseography","id":9721671,"avatar_url":"https://avatars.githubusercontent.com/u/9721671?v=3","gravatar_id":"","url":"https://api.github.com/users/Courseography","html_url":"https://github.com/Courseography","followers_url":"https://api.github.com/users/Courseography/followers","following_url":"https://api.github.com/users/Courseography/following{/other_user}","gists_url":"https://api.github.com/users/Courseography/gists{/gist_id}","starred_url":"https://api.github.com/users/Courseography/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Courseography/subscriptions","organizations_url":"https://api.github.com/users/Courseography/orgs","repos_url":"https://api.github.com/users/Courseography/repos","events_url":"https://api.github.com/users/Courseography/events{/privacy}","received_events_url":"https://api.github.com/users/Courseography/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Courseography/courseography","description":"Courseography is a tool created by David Liu and Ian Stewart-Binks to guide students through their undergraduate careers.","fork":false,"url":"https://api.github.com/repos/Courseography/courseography","forks_url":"https://api.github.com/repos/Courseography/courseography/forks","keys_url":"https://api.github.com/repos/Courseography/courseography/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Courseography/courseography/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Courseography/courseography/teams","hooks_url":"https://api.github.com/repos/Courseography/courseography/hooks","issue_events_url":"https://api.github.com/repos/Courseography/courseography/issues/events{/number}","events_url":"https://api.github.com/repos/Courseography/courseography/events","assignees_url":"https://api.github.com/repos/Courseography/courseography/assignees{/user}","branches_url":"https://api.github.com/repos/Courseography/courseography/branches{/branch}","tags_url":"https://api.github.com/repos/Courseography/courseography/tags","blobs_url":"https://api.github.com/repos/Courseography/courseography/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Courseography/courseography/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Courseography/courseography/git/refs{/sha}","trees_url":"https://api.github.com/repos/Courseography/courseography/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Courseography/courseography/statuses/{sha}","languages_url":"https://api.github.com/repos/Courseography/courseography/languages","stargazers_url":"https://api.github.com/repos/Courseography/courseography/stargazers","contributors_url":"https://api.github.com/repos/Courseography/courseography/contributors","subscribers_url":"https://api.github.com/repos/Courseography/courseography/subscribers","subscription_url":"https://api.github.com/repos/Courseography/courseography/subscription","commits_url":"https://api.github.com/repos/Courseography/courseography/commits{/sha}","git_commits_url":"https://api.github.com/repos/Courseography/courseography/git/commits{/sha}","comments_url":"https://api.github.com/repos/Courseography/courseography/comments{/number}","issue_comment_url":"https://api.github.com/repos/Courseography/courseography/issues/comments{/number}","contents_url":"https://api.github.com/repos/Courseography/courseography/contents/{+path}","compare_url":"https://api.github.com/repos/Courseography/courseography/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Courseography/courseography/merges","archive_url":"https://api.github.com/repos/Courseography/courseography/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Courseography/courseography/downloads","issues_url":"https://api.github.com/repos/Courseography/courseography/issues{/number}","pulls_url":"https://api.github.com/repos/Courseography/courseography/pulls{/number}","milestones_url":"https://api.github.com/repos/Courseography/courseography/milestones{/number}","notifications_url":"https://api.github.com/repos/Courseography/courseography/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Courseography/courseography/labels{/name}","releases_url":"https://api.github.com/repos/Courseography/courseography/releases{/id}","deployments_url":"https://api.github.com/repos/Courseography/courseography/deployments","created_at":"2014-02-15T22:32:22Z","updated_at":"2016-05-11T02:58:50Z","pushed_at":"2016-05-19T00:52:37Z","git_url":"git://github.com/Courseography/courseography.git","ssh_url":"git@github.com:Courseography/courseography.git","clone_url":"https://github.com/Courseography/courseography.git","svn_url":"https://github.com/Courseography/courseography","homepage":"","size":60778,"stargazers_count":22,"watchers_count":22,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":64,"forks":32,"open_issues":64,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/829"},"html":{"href":"https://github.com/Courseography/courseography/pull/829"},"issue":{"href":"https://api.github.com/repos/Courseography/courseography/issues/829"},"comments":{"href":"https://api.github.com/repos/Courseography/courseography/issues/829/comments"},"review_comments":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/829/comments"},"review_comment":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/829/commits"},"statuses":{"href":"https://api.github.com/repos/Courseography/courseography/statuses/406af285e17bb1e5cd4623b9ef2ce8d1fb62d47d"}}}}