{"action":"created","comment":{"url":"https://api.github.com/repos/dev-onenetworkecommerce/aia/pulls/comments/45621501","id":45621501,"diff_hunk":"@@ -0,0 +1,147 @@\n+import React, { cloneElement, PropTypes } from 'react';\n+import { render, unmountComponentAtNode, findDOMNode } from 'react-dom';\n+import { addClass, removeClass } from '../../utils/DomUtils';\n+import utils from './utils';\n+\n+const ARROW_LEFT = 'tooltip -arrowright';\n+const ARROW_RIGHT = 'tooltip -arrowleft';\n+const ARROW_UP = 'tooltip -arrowdown';\n+const ARROW_DOWN = 'tooltip -arrowup';\n+\n+\n+export default class ToolTip extends React.Component {\n+\n+  constructor(props) {\n+    super(props);\n+\n+    this.handleMouseEnter = ::this.handleMouseEnter;\n+    this.handleMouseOut = ::this.handleMouseOut;\n+  }\n+\n+  state = {\n+    show: false,\n+    top: 0,\n+    left: 0\n+  }\n+\n+  static PropTypes = {\n+    position: PropTypes.oneOf([\n+    'top',\n+    'left',\n+    'right',\n+    'bottom'\n+    ]).isRequired,\n+    text: PropTypes.string.isRequired\n+  };\n+\n+  static defaultProps = {\n+    position: 'left',\n+    text: 'Input Tooltip Text here',\n+  }\n+\n+  componentDidMount() {\n+    this.mountContainer();\n+    if ( this.state.show ) {\n+      this.mountTooltip();\n+    }\n+    findDOMNode(this).addEventListener('mouseenter', this.handleMouseEnter);\n+    findDOMNode(this).addEventListener('mouseout', this.handleMouseOut);\n+  };\n+\n+  componentWillUnmount() {\n+    this.unmountTooltip();\n+    this.unmountContainer();\n+    findDOMNode(this).removeEventListener('mouseenter', this.handleMouseEnter);\n+    findDOMNode(this).removeEventListener('mouseout', this.handleMouseOut);\n+  };\n+\n+  componentDidUpdate() {\n+     this.state.show\n+     ? this.mountTooltip()\n+     : this.unmountTooltip();\n+  }\n+\n+  render() {\n+    return <span>{this.props.children}</span>;\n+  };\n+\n+\n+  mountContainer() {\n+    this.$container = document.createElement('div');\n+    document.body.appendChild(this.$container);\n+  };\n+\n+  unmountContainer() {\n+    if ( this.$container == null ) {\n+      return ;\n+    }\n+\n+    document.body.removeChild(this.$container);\n+    this.$container = null;\n+  };\n+\n+  mountTooltip() {\n+    if ( !this.$container ) {\n+      throw new Error(\n+        'The container does not exist. ' +\n+        'It may have been removed, or whatever'\n+      );\n+    }\n+\n+    this.$tooltip = render(","path":"scripts/components/Tooltip/index.jsx","position":91,"original_position":91,"commit_id":"e45f1b365fbd0c2893eebfaa7d9fc1160d2c55d3","original_commit_id":"e45f1b365fbd0c2893eebfaa7d9fc1160d2c55d3","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":"Instead of using `ReactDOM.render`, use [`unstable_renderSubtreeIntoContainer`](https://github.com/dev-onenetworkecommerce/aia/commit/b75f4c19c98dd8cc05bcabf07bbfafc3d61964fa)","created_at":"2015-11-23T16:08:46Z","updated_at":"2015-11-23T16:08:46Z","html_url":"https://github.com/dev-onenetworkecommerce/aia/pull/114#discussion_r45621501","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/45621501"},"html":{"href":"https://github.com/dev-onenetworkecommerce/aia/pull/114#discussion_r45621501"},"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-23T16:08:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3dee314b13f23d5e191d32d751c34c5c871b17a","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/e45f1b365fbd0c2893eebfaa7d9fc1160d2c55d3","head":{"label":"dev-onenetworkecommerce:tooltip","ref":"tooltip","sha":"e45f1b365fbd0c2893eebfaa7d9fc1160d2c55d3","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-11-11T21:47:07Z","pushed_at":"2015-11-23T11:15:28Z","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":7386,"stargazers_count":7,"watchers_count":7,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":43,"forks":1,"open_issues":43,"watchers":7,"default_branch":"master"}},"base":{"label":"dev-onenetworkecommerce:master","ref":"master","sha":"872adcab0f007204d75c50f93260281ce1472888","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-11-11T21:47:07Z","pushed_at":"2015-11-23T11:15:28Z","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":7386,"stargazers_count":7,"watchers_count":7,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":43,"forks":1,"open_issues":43,"watchers":7,"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/e45f1b365fbd0c2893eebfaa7d9fc1160d2c55d3"}}}}