{"action":"created","comment":{"url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/pulls/comments/44103690","id":44103690,"diff_hunk":"@@ -0,0 +1,55 @@\n+export default {\n+  /**\n+   * Calculates the position of the overlay (tooltip)\n+   *\n+   * The math here is as simple as the requirement. We just\n+   * want the tooltip to appear in the center of the provided\n+   * placement (for example, horizontally center it if top or btm;\n+   * or vertically center it if left or right).\n+   *\n+   * To center `top`:\n+   * (left): (<A> + <B / 2> + <C / 2>)\n+   * A = offsetLeft; distance between the left-most screen and `trigger`\n+   * B = ./.\n+   * C = ./.\n+   *\n+   * I left a comment here because the terminologies were a bit confusing.\n+   * There's duplicated code (for example, top and bottom had the same `left` offset;\n+   * left and right had the same `top` offset) because obviously, it would be unnecessarily\n+   * more expensive and/or the code with be more lengthy (which is seriously fucking bad).\n+   */\n+  calculatePosition(trigger, overlay, placement) {\n+    const coords = trigger.getBoundingClientRect();\n+    const coordsTop = coords.top,\n+          coordsBottom = coords.bottom,\n+          coordsLeft = coords.left,\n+          coordsRight = coords.right,\n+          ADD_MARGIN = 8;","path":"scripts/components/Tooltip/utils.js","position":27,"original_position":27,"commit_id":"99a2533cef5fb88456e3ea6f99d2f2dc4228cc20","original_commit_id":"99a2533cef5fb88456e3ea6f99d2f2dc4228cc20","user":{"login":"srph","id":5093058,"avatar_url":"https://avatars.githubusercontent.com/u/5093058?v=3","gravatar_id":"","url":"https://api.github.com/users/srph","html_url":"https://github.com/srph","followers_url":"https://api.github.com/users/srph/followers","following_url":"https://api.github.com/users/srph/following{/other_user}","gists_url":"https://api.github.com/users/srph/gists{/gist_id}","starred_url":"https://api.github.com/users/srph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srph/subscriptions","organizations_url":"https://api.github.com/users/srph/orgs","repos_url":"https://api.github.com/users/srph/repos","events_url":"https://api.github.com/users/srph/events{/privacy}","received_events_url":"https://api.github.com/users/srph/received_events","type":"User","site_admin":false},"body":"I don't think you need this. Just add a margin to the class, and it'll do its job. Ask @JefMari ","created_at":"2015-11-06T04:38:00Z","updated_at":"2015-11-06T04:38:00Z","html_url":"https://github.com/dev-onenetworkecommerce/aia/pull/114#discussion_r44103690","pull_request_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/pulls/114","_links":{"self":{"href":"https://api.github.com/repos/dev-onenetworkecommerce/aia/pulls/comments/44103690"},"html":{"href":"https://github.com/dev-onenetworkecommerce/aia/pull/114#discussion_r44103690"},"pull_request":{"href":"https://api.github.com/repos/dev-onenetworkecommerce/aia/pulls/114"}}},"pull_request":{"url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/pulls/114","id":48986431,"html_url":"https://github.com/dev-onenetworkecommerce/aia/pull/114","diff_url":"https://github.com/dev-onenetworkecommerce/aia/pull/114.diff","patch_url":"https://github.com/dev-onenetworkecommerce/aia/pull/114.patch","issue_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/issues/114","number":114,"state":"open","locked":false,"title":"adding component tooltip","user":{"login":"vistajess","id":12708502,"avatar_url":"https://avatars.githubusercontent.com/u/12708502?v=3","gravatar_id":"","url":"https://api.github.com/users/vistajess","html_url":"https://github.com/vistajess","followers_url":"https://api.github.com/users/vistajess/followers","following_url":"https://api.github.com/users/vistajess/following{/other_user}","gists_url":"https://api.github.com/users/vistajess/gists{/gist_id}","starred_url":"https://api.github.com/users/vistajess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vistajess/subscriptions","organizations_url":"https://api.github.com/users/vistajess/orgs","repos_url":"https://api.github.com/users/vistajess/repos","events_url":"https://api.github.com/users/vistajess/events{/privacy}","received_events_url":"https://api.github.com/users/vistajess/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-28T10:19:54Z","updated_at":"2015-11-06T04:38:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a045feb5f0130e54472c032e01c6131aa1dfcefe","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/pulls/114/commits","review_comments_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/pulls/114/comments","review_comment_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/issues/114/comments","statuses_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/statuses/99a2533cef5fb88456e3ea6f99d2f2dc4228cc20","head":{"label":"dev-onenetworkecommerce:tooltip","ref":"tooltip","sha":"99a2533cef5fb88456e3ea6f99d2f2dc4228cc20","user":{"login":"dev-onenetworkecommerce","id":12614777,"avatar_url":"https://avatars.githubusercontent.com/u/12614777?v=3","gravatar_id":"","url":"https://api.github.com/users/dev-onenetworkecommerce","html_url":"https://github.com/dev-onenetworkecommerce","followers_url":"https://api.github.com/users/dev-onenetworkecommerce/followers","following_url":"https://api.github.com/users/dev-onenetworkecommerce/following{/other_user}","gists_url":"https://api.github.com/users/dev-onenetworkecommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/dev-onenetworkecommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dev-onenetworkecommerce/subscriptions","organizations_url":"https://api.github.com/users/dev-onenetworkecommerce/orgs","repos_url":"https://api.github.com/users/dev-onenetworkecommerce/repos","events_url":"https://api.github.com/users/dev-onenetworkecommerce/events{/privacy}","received_events_url":"https://api.github.com/users/dev-onenetworkecommerce/received_events","type":"Organization","site_admin":false},"repo":{"id":42233150,"name":"aia","full_name":"dev-onenetworkecommerce/aia","owner":{"login":"dev-onenetworkecommerce","id":12614777,"avatar_url":"https://avatars.githubusercontent.com/u/12614777?v=3","gravatar_id":"","url":"https://api.github.com/users/dev-onenetworkecommerce","html_url":"https://github.com/dev-onenetworkecommerce","followers_url":"https://api.github.com/users/dev-onenetworkecommerce/followers","following_url":"https://api.github.com/users/dev-onenetworkecommerce/following{/other_user}","gists_url":"https://api.github.com/users/dev-onenetworkecommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/dev-onenetworkecommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dev-onenetworkecommerce/subscriptions","organizations_url":"https://api.github.com/users/dev-onenetworkecommerce/orgs","repos_url":"https://api.github.com/users/dev-onenetworkecommerce/repos","events_url":"https://api.github.com/users/dev-onenetworkecommerce/events{/privacy}","received_events_url":"https://api.github.com/users/dev-onenetworkecommerce/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dev-onenetworkecommerce/aia","description":"The UI Toolkit that powers ONE's internal projects","fork":false,"url":"https://api.github.com/repos/dev-onenetworkecommerce/aia","forks_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/forks","keys_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/teams","hooks_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/hooks","issue_events_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/issues/events{/number}","events_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/events","assignees_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/assignees{/user}","branches_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/branches{/branch}","tags_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/tags","blobs_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/git/refs{/sha}","trees_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/statuses/{sha}","languages_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/languages","stargazers_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/stargazers","contributors_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/contributors","subscribers_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/subscribers","subscription_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/subscription","commits_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/commits{/sha}","git_commits_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/git/commits{/sha}","comments_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/comments{/number}","issue_comment_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/issues/comments{/number}","contents_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/contents/{+path}","compare_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/merges","archive_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/downloads","issues_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/issues{/number}","pulls_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/pulls{/number}","milestones_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/milestones{/number}","notifications_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/labels{/name}","releases_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/releases{/id}","created_at":"2015-09-10T08:45:57Z","updated_at":"2015-10-15T14:00:37Z","pushed_at":"2015-11-05T07:50:58Z","git_url":"git://github.com/dev-onenetworkecommerce/aia.git","ssh_url":"git@github.com:dev-onenetworkecommerce/aia.git","clone_url":"https://github.com/dev-onenetworkecommerce/aia.git","svn_url":"https://github.com/dev-onenetworkecommerce/aia","homepage":"https://rawgit.com/dev-onenetworkecommerce/aia/master/docs/index.html#/scaffolding?_k=wflhj2","size":11316,"stargazers_count":6,"watchers_count":6,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":33,"forks":1,"open_issues":33,"watchers":6,"default_branch":"master"}},"base":{"label":"dev-onenetworkecommerce:master","ref":"master","sha":"12b7c94fb5f6f2e6551441bf9be8bb88dca20e65","user":{"login":"dev-onenetworkecommerce","id":12614777,"avatar_url":"https://avatars.githubusercontent.com/u/12614777?v=3","gravatar_id":"","url":"https://api.github.com/users/dev-onenetworkecommerce","html_url":"https://github.com/dev-onenetworkecommerce","followers_url":"https://api.github.com/users/dev-onenetworkecommerce/followers","following_url":"https://api.github.com/users/dev-onenetworkecommerce/following{/other_user}","gists_url":"https://api.github.com/users/dev-onenetworkecommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/dev-onenetworkecommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dev-onenetworkecommerce/subscriptions","organizations_url":"https://api.github.com/users/dev-onenetworkecommerce/orgs","repos_url":"https://api.github.com/users/dev-onenetworkecommerce/repos","events_url":"https://api.github.com/users/dev-onenetworkecommerce/events{/privacy}","received_events_url":"https://api.github.com/users/dev-onenetworkecommerce/received_events","type":"Organization","site_admin":false},"repo":{"id":42233150,"name":"aia","full_name":"dev-onenetworkecommerce/aia","owner":{"login":"dev-onenetworkecommerce","id":12614777,"avatar_url":"https://avatars.githubusercontent.com/u/12614777?v=3","gravatar_id":"","url":"https://api.github.com/users/dev-onenetworkecommerce","html_url":"https://github.com/dev-onenetworkecommerce","followers_url":"https://api.github.com/users/dev-onenetworkecommerce/followers","following_url":"https://api.github.com/users/dev-onenetworkecommerce/following{/other_user}","gists_url":"https://api.github.com/users/dev-onenetworkecommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/dev-onenetworkecommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dev-onenetworkecommerce/subscriptions","organizations_url":"https://api.github.com/users/dev-onenetworkecommerce/orgs","repos_url":"https://api.github.com/users/dev-onenetworkecommerce/repos","events_url":"https://api.github.com/users/dev-onenetworkecommerce/events{/privacy}","received_events_url":"https://api.github.com/users/dev-onenetworkecommerce/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dev-onenetworkecommerce/aia","description":"The UI Toolkit that powers ONE's internal projects","fork":false,"url":"https://api.github.com/repos/dev-onenetworkecommerce/aia","forks_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/forks","keys_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/teams","hooks_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/hooks","issue_events_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/issues/events{/number}","events_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/events","assignees_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/assignees{/user}","branches_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/branches{/branch}","tags_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/tags","blobs_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/git/refs{/sha}","trees_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/statuses/{sha}","languages_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/languages","stargazers_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/stargazers","contributors_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/contributors","subscribers_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/subscribers","subscription_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/subscription","commits_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/commits{/sha}","git_commits_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/git/commits{/sha}","comments_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/comments{/number}","issue_comment_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/issues/comments{/number}","contents_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/contents/{+path}","compare_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/merges","archive_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/downloads","issues_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/issues{/number}","pulls_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/pulls{/number}","milestones_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/milestones{/number}","notifications_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/labels{/name}","releases_url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/releases{/id}","created_at":"2015-09-10T08:45:57Z","updated_at":"2015-10-15T14:00:37Z","pushed_at":"2015-11-05T07:50:58Z","git_url":"git://github.com/dev-onenetworkecommerce/aia.git","ssh_url":"git@github.com:dev-onenetworkecommerce/aia.git","clone_url":"https://github.com/dev-onenetworkecommerce/aia.git","svn_url":"https://github.com/dev-onenetworkecommerce/aia","homepage":"https://rawgit.com/dev-onenetworkecommerce/aia/master/docs/index.html#/scaffolding?_k=wflhj2","size":11316,"stargazers_count":6,"watchers_count":6,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":33,"forks":1,"open_issues":33,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dev-onenetworkecommerce/aia/pulls/114"},"html":{"href":"https://github.com/dev-onenetworkecommerce/aia/pull/114"},"issue":{"href":"https://api.github.com/repos/dev-onenetworkecommerce/aia/issues/114"},"comments":{"href":"https://api.github.com/repos/dev-onenetworkecommerce/aia/issues/114/comments"},"review_comments":{"href":"https://api.github.com/repos/dev-onenetworkecommerce/aia/pulls/114/comments"},"review_comment":{"href":"https://api.github.com/repos/dev-onenetworkecommerce/aia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dev-onenetworkecommerce/aia/pulls/114/commits"},"statuses":{"href":"https://api.github.com/repos/dev-onenetworkecommerce/aia/statuses/99a2533cef5fb88456e3ea6f99d2f2dc4228cc20"}}}}