{"action":"created","comment":{"url":"https://api.github.com/repos/Financial-Times/o-tooltip/pulls/comments/106638070","pull_request_review_id":27570002,"id":106638070,"diff_hunk":"@@ -0,0 +1,420 @@\n+import Delegate from 'ftdomdelegate';\n+import Viewport from 'o-viewport';\n+\n+import Target from './target';\n+\n+class Tooltip {\n+\n+\t/**\n+\t * Represents a tooltip.\n+\t * @constructor\n+\t * @param {HTMLElement} tooltipEl - The tooltip element in the DOM (Required)\n+\t * @param {Object} opts - An options object for configuring the tooltip (Optional)\n+\t*/\n+\tconstructor (tooltipEl, opts) {\n+\n+\t\tif (!Tooltip._tooltips) {\n+\t\t\tTooltip._tooltips = new Map();\n+\t\t}\n+\n+\t\tthis.tooltipEl = tooltipEl;\n+\t\tTooltip._tooltips.set(this.tooltipEl, this);\n+\n+\t\tthis.opts = opts || Tooltip.getOptions(tooltipEl);\n+\t\tthis.opts = Tooltip.checkOptions(this.opts);\n+\n+\t\tthis.target = new Tooltip.Target(document.getElementById(this.opts.target));\n+\t\tthis.tooltipPosition = this.opts.position;\n+\t\tthis.tooltipAlignment = null;\n+\t\tthis.visible = false;\n+\n+\t\tthis.delegates = {\n+\t\t\tdoc: new Delegate(),\n+\t\t\ttooltip: new Delegate(),\n+\t\t};\n+\n+\t\tViewport.listenTo('resize');\n+\n+\t\t// Do you render as soon as possible?\n+\t\tif (this.opts.renderOnConstruction) {\n+\t\t\tthis.render();\n+\t\t\tthis.show();\n+\t\t}\n+\t};\n+\n+\t/**\n+\t * Get the data attributes from the tooltipEl. If the tooltip is being set up\n+\t * declaratively, this method is used to extract the data attributes from\n+\t * the DOM.\n+\t * @param {HTMLElement} tooltipEl - The tooltip element in the DOM (Required)\n+\t * @todo - refactor this out to smartly iterate over data attributes\n+\t*/\n+\tstatic getOptions(tooltipEl) {\n+\t\tlet opts = {};\n+\t\tif (tooltipEl.hasAttribute('data-o-tooltip-position')) {\n+\t\t\topts.position = tooltipEl.getAttribute('data-o-tooltip-position');\n+\t\t}\n+\t\tif (tooltipEl.hasAttribute('data-o-tooltip-target')) {\n+\t\t\topts.target = tooltipEl.getAttribute('data-o-tooltip-target');\n+\t\t}\n+\n+\t\tif (tooltipEl.hasAttribute('data-o-tooltip-render-on-construction')){\n+\t\t\topts.renderOnConstruction = (tooltipEl.getAttribute('data-o-tooltip-render-on-construction') === 'true');\n+\t\t}\n+\n+\t\tif (tooltipEl.hasAttribute('data-o-tooltip-z-index')){\n+\t\t\topts.zIndex = tooltipEl.getAttribute('data-o-tooltip-z-index');\n+\t\t}\n+\t\treturn opts;\n+\t};\n+\n+\t/**\n+\t * Check the options passed in are valid, and that the required option\n+\t * (target) is present\n+\t * @param {Object} opts - An Object with configuration options for the tooltip\n+\t * @throws o-tooltip error: opts.target us not set\n+\t * @throws o-tooltip error: opts.tooltipPosition is not one of \"above\", \"below\"\n+\t * \"left\" or \"right\"\n+\t*/\n+\t\tstatic checkOptions(opts) {","path":"src/js/tooltip.js","position":79,"original_position":79,"commit_id":"d0df6249ee39dd1a248019cd0373cff8f37f7a46","original_commit_id":"d0df6249ee39dd1a248019cd0373cff8f37f7a46","user":{"login":"onishiweb","id":1240073,"avatar_url":"https://avatars1.githubusercontent.com/u/1240073?v=3","gravatar_id":"","url":"https://api.github.com/users/onishiweb","html_url":"https://github.com/onishiweb","followers_url":"https://api.github.com/users/onishiweb/followers","following_url":"https://api.github.com/users/onishiweb/following{/other_user}","gists_url":"https://api.github.com/users/onishiweb/gists{/gist_id}","starred_url":"https://api.github.com/users/onishiweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onishiweb/subscriptions","organizations_url":"https://api.github.com/users/onishiweb/orgs","repos_url":"https://api.github.com/users/onishiweb/repos","events_url":"https://api.github.com/users/onishiweb/events{/privacy}","received_events_url":"https://api.github.com/users/onishiweb/received_events","type":"User","site_admin":false},"body":"One indent too far?","created_at":"2017-03-17T12:20:59Z","updated_at":"2017-03-17T12:36:29Z","html_url":"https://github.com/Financial-Times/o-tooltip/pull/7#discussion_r106638070","pull_request_url":"https://api.github.com/repos/Financial-Times/o-tooltip/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/o-tooltip/pulls/comments/106638070"},"html":{"href":"https://github.com/Financial-Times/o-tooltip/pull/7#discussion_r106638070"},"pull_request":{"href":"https://api.github.com/repos/Financial-Times/o-tooltip/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/Financial-Times/o-tooltip/pulls/7","id":111254959,"html_url":"https://github.com/Financial-Times/o-tooltip/pull/7","diff_url":"https://github.com/Financial-Times/o-tooltip/pull/7.diff","patch_url":"https://github.com/Financial-Times/o-tooltip/pull/7.patch","issue_url":"https://api.github.com/repos/Financial-Times/o-tooltip/issues/7","number":7,"state":"open","locked":false,"title":"v1!","user":{"login":"alicebartlett","id":68009,"avatar_url":"https://avatars3.githubusercontent.com/u/68009?v=3","gravatar_id":"","url":"https://api.github.com/users/alicebartlett","html_url":"https://github.com/alicebartlett","followers_url":"https://api.github.com/users/alicebartlett/followers","following_url":"https://api.github.com/users/alicebartlett/following{/other_user}","gists_url":"https://api.github.com/users/alicebartlett/gists{/gist_id}","starred_url":"https://api.github.com/users/alicebartlett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alicebartlett/subscriptions","organizations_url":"https://api.github.com/users/alicebartlett/orgs","repos_url":"https://api.github.com/users/alicebartlett/repos","events_url":"https://api.github.com/users/alicebartlett/events{/privacy}","received_events_url":"https://api.github.com/users/alicebartlett/received_events","type":"User","site_admin":false},"body":"This component is now ready for a big review and then a beta release.\r\n\r\n@JakeChampion and @onishiweb I'd really appreciate your feedback. Specifically I'd like you to check:\r\n\r\n- The documentation makes sense\r\n- The JavaScript (particularly things that are difficult to change, like the API)\r\n- The Sass (again, particularly things that are difficult to change, like the class names and mixin names)","created_at":"2017-03-17T10:42:08Z","updated_at":"2017-03-17T12:36:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"783de90ba9e8acdd86012fc572f9d5c8aeacf477","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Financial-Times/o-tooltip/pulls/7/commits","review_comments_url":"https://api.github.com/repos/Financial-Times/o-tooltip/pulls/7/comments","review_comment_url":"https://api.github.com/repos/Financial-Times/o-tooltip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Financial-Times/o-tooltip/issues/7/comments","statuses_url":"https://api.github.com/repos/Financial-Times/o-tooltip/statuses/d0df6249ee39dd1a248019cd0373cff8f37f7a46","head":{"label":"Financial-Times:master","ref":"master","sha":"d0df6249ee39dd1a248019cd0373cff8f37f7a46","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars2.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":79123180,"name":"o-tooltip","full_name":"Financial-Times/o-tooltip","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars2.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/o-tooltip","description":null,"fork":false,"url":"https://api.github.com/repos/Financial-Times/o-tooltip","forks_url":"https://api.github.com/repos/Financial-Times/o-tooltip/forks","keys_url":"https://api.github.com/repos/Financial-Times/o-tooltip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/o-tooltip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/o-tooltip/teams","hooks_url":"https://api.github.com/repos/Financial-Times/o-tooltip/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/o-tooltip/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/o-tooltip/events","assignees_url":"https://api.github.com/repos/Financial-Times/o-tooltip/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/o-tooltip/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/o-tooltip/tags","blobs_url":"https://api.github.com/repos/Financial-Times/o-tooltip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/o-tooltip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/o-tooltip/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/o-tooltip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/o-tooltip/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/o-tooltip/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/o-tooltip/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/o-tooltip/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/o-tooltip/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/o-tooltip/subscription","commits_url":"https://api.github.com/repos/Financial-Times/o-tooltip/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/o-tooltip/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/o-tooltip/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/o-tooltip/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/o-tooltip/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/o-tooltip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/o-tooltip/merges","archive_url":"https://api.github.com/repos/Financial-Times/o-tooltip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/o-tooltip/downloads","issues_url":"https://api.github.com/repos/Financial-Times/o-tooltip/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/o-tooltip/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/o-tooltip/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/o-tooltip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/o-tooltip/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/o-tooltip/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/o-tooltip/deployments","created_at":"2017-01-16T13:53:34Z","updated_at":"2017-01-16T15:23:41Z","pushed_at":"2017-03-17T10:49:26Z","git_url":"git://github.com/Financial-Times/o-tooltip.git","ssh_url":"git@github.com:Financial-Times/o-tooltip.git","clone_url":"https://github.com/Financial-Times/o-tooltip.git","svn_url":"https://github.com/Financial-Times/o-tooltip","homepage":null,"size":59,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"Financial-Times:v1-beta","ref":"v1-beta","sha":"21eb3f33be3a4172a9bfbc1c397237021bc6a307","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars2.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":79123180,"name":"o-tooltip","full_name":"Financial-Times/o-tooltip","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars2.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/o-tooltip","description":null,"fork":false,"url":"https://api.github.com/repos/Financial-Times/o-tooltip","forks_url":"https://api.github.com/repos/Financial-Times/o-tooltip/forks","keys_url":"https://api.github.com/repos/Financial-Times/o-tooltip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/o-tooltip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/o-tooltip/teams","hooks_url":"https://api.github.com/repos/Financial-Times/o-tooltip/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/o-tooltip/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/o-tooltip/events","assignees_url":"https://api.github.com/repos/Financial-Times/o-tooltip/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/o-tooltip/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/o-tooltip/tags","blobs_url":"https://api.github.com/repos/Financial-Times/o-tooltip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/o-tooltip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/o-tooltip/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/o-tooltip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/o-tooltip/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/o-tooltip/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/o-tooltip/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/o-tooltip/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/o-tooltip/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/o-tooltip/subscription","commits_url":"https://api.github.com/repos/Financial-Times/o-tooltip/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/o-tooltip/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/o-tooltip/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/o-tooltip/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/o-tooltip/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/o-tooltip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/o-tooltip/merges","archive_url":"https://api.github.com/repos/Financial-Times/o-tooltip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/o-tooltip/downloads","issues_url":"https://api.github.com/repos/Financial-Times/o-tooltip/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/o-tooltip/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/o-tooltip/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/o-tooltip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/o-tooltip/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/o-tooltip/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/o-tooltip/deployments","created_at":"2017-01-16T13:53:34Z","updated_at":"2017-01-16T15:23:41Z","pushed_at":"2017-03-17T10:49:26Z","git_url":"git://github.com/Financial-Times/o-tooltip.git","ssh_url":"git@github.com:Financial-Times/o-tooltip.git","clone_url":"https://github.com/Financial-Times/o-tooltip.git","svn_url":"https://github.com/Financial-Times/o-tooltip","homepage":null,"size":59,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/o-tooltip/pulls/7"},"html":{"href":"https://github.com/Financial-Times/o-tooltip/pull/7"},"issue":{"href":"https://api.github.com/repos/Financial-Times/o-tooltip/issues/7"},"comments":{"href":"https://api.github.com/repos/Financial-Times/o-tooltip/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/Financial-Times/o-tooltip/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/Financial-Times/o-tooltip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Financial-Times/o-tooltip/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/Financial-Times/o-tooltip/statuses/d0df6249ee39dd1a248019cd0373cff8f37f7a46"}}}}
{"actor":{"display_login":"onishiweb"}}