{"action":"created","comment":{"url":"https://api.github.com/repos/Financial-Times/n-myft-ui/pulls/comments/195225107","pull_request_review_id":128551367,"id":195225107,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTIyNTEwNw==","diff_hunk":"@@ -0,0 +1,47 @@\n+import Delegate from 'ftdomdelegate';\n+import myftApiClient from 'next-myft-client';\n+\n+const delegate = new Delegate(document.body);\n+\n+const trackPinningAction = ({ action }) =>\n+\tnew CustomEvent('oTracking.event', {\n+\t\tdetail: {\n+\t\t\tcategory: 'component',\n+\t\t\tmessaging: 'myft-onboarding-pinning-promo',\n+\t\t\taction\n+\t\t},\n+\t\tbubbles: true\n+\t});\n+\n+const findAncestor = (el, cls) => {\n+\twhile ((el = el.parentElement) && !el.classList.contains(cls)) {}","path":"components/pin-button/index.js","position":17,"original_position":17,"commit_id":"6af434119cea9a20f8281868ea12630c52cbf305","original_commit_id":"6af434119cea9a20f8281868ea12630c52cbf305","user":{"login":"dan-searle","id":2759279,"node_id":"MDQ6VXNlcjI3NTkyNzk=","avatar_url":"https://avatars3.githubusercontent.com/u/2759279?v=4","gravatar_id":"","url":"https://api.github.com/users/dan-searle","html_url":"https://github.com/dan-searle","followers_url":"https://api.github.com/users/dan-searle/followers","following_url":"https://api.github.com/users/dan-searle/following{/other_user}","gists_url":"https://api.github.com/users/dan-searle/gists{/gist_id}","starred_url":"https://api.github.com/users/dan-searle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dan-searle/subscriptions","organizations_url":"https://api.github.com/users/dan-searle/orgs","repos_url":"https://api.github.com/users/dan-searle/repos","events_url":"https://api.github.com/users/dan-searle/events{/privacy}","received_events_url":"https://api.github.com/users/dan-searle/received_events","type":"User","site_admin":false},"body":"Yeah, I don't particularly like this function's implementation either - I had intended to revisit it, but forgot 😊. I'm happy to it change it to your nicer recursive one.\r\n\r\nThe main reason I changed the previous `setLoading` function was that it was doing two things (finding an ancestor with a particular class, and then setting a class on it). I was just trying to move to a more functional, composable kind of approach.\r\n\r\nRe `el` or `element` - I have no strong opinion, but `el` is fairly common (at least in MDN web docs). I was mainly trying to address the previous mix of `node` and `element`.","created_at":"2018-06-13T20:29:41Z","updated_at":"2018-06-13T20:29:41Z","html_url":"https://github.com/Financial-Times/n-myft-ui/pull/169#discussion_r195225107","pull_request_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/pulls/169","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/n-myft-ui/pulls/comments/195225107"},"html":{"href":"https://github.com/Financial-Times/n-myft-ui/pull/169#discussion_r195225107"},"pull_request":{"href":"https://api.github.com/repos/Financial-Times/n-myft-ui/pulls/169"}},"in_reply_to_id":195178023},"pull_request":{"url":"https://api.github.com/repos/Financial-Times/n-myft-ui/pulls/169","id":194555125,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0NTU1MTI1","html_url":"https://github.com/Financial-Times/n-myft-ui/pull/169","diff_url":"https://github.com/Financial-Times/n-myft-ui/pull/169.diff","patch_url":"https://github.com/Financial-Times/n-myft-ui/pull/169.patch","issue_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/issues/169","number":169,"state":"closed","locked":false,"title":"Move pin-button into components","user":{"login":"dan-searle","id":2759279,"node_id":"MDQ6VXNlcjI3NTkyNzk=","avatar_url":"https://avatars3.githubusercontent.com/u/2759279?v=4","gravatar_id":"","url":"https://api.github.com/users/dan-searle","html_url":"https://github.com/dan-searle","followers_url":"https://api.github.com/users/dan-searle/followers","following_url":"https://api.github.com/users/dan-searle/following{/other_user}","gists_url":"https://api.github.com/users/dan-searle/gists{/gist_id}","starred_url":"https://api.github.com/users/dan-searle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dan-searle/subscriptions","organizations_url":"https://api.github.com/users/dan-searle/orgs","repos_url":"https://api.github.com/users/dan-searle/repos","events_url":"https://api.github.com/users/dan-searle/events{/privacy}","received_events_url":"https://api.github.com/users/dan-searle/received_events","type":"User","site_admin":false},"body":"Fixes #163 \r\n\r\nIt seems n-topic-card is the only place outside of this repo that uses pin-button (and just the template): https://github.com/search?q=org%3AFinancial-Times+pin-button&type=Code","created_at":"2018-06-13T11:30:07Z","updated_at":"2018-06-13T20:29:41Z","closed_at":"2018-06-13T13:55:09Z","merged_at":"2018-06-13T13:55:09Z","merge_commit_sha":"d1d19aa94a233387ea081dfcef5771d7433ad18d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/pulls/169/commits","review_comments_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/pulls/169/comments","review_comment_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/issues/169/comments","statuses_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/statuses/6af434119cea9a20f8281868ea12630c52cbf305","head":{"label":"Financial-Times:move-pin-button-into-components","ref":"move-pin-button-into-components","sha":"6af434119cea9a20f8281868ea12630c52cbf305","user":{"login":"Financial-Times","id":3502508,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MDI1MDg=","avatar_url":"https://avatars1.githubusercontent.com/u/3502508?v=4","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":83317556,"node_id":"MDEwOlJlcG9zaXRvcnk4MzMxNzU1Ng==","name":"n-myft-ui","full_name":"Financial-Times/n-myft-ui","owner":{"login":"Financial-Times","id":3502508,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MDI1MDg=","avatar_url":"https://avatars1.githubusercontent.com/u/3502508?v=4","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/n-myft-ui","description":"Client side component for interaction with myft","fork":false,"url":"https://api.github.com/repos/Financial-Times/n-myft-ui","forks_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/forks","keys_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/teams","hooks_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/events","assignees_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/tags","blobs_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/subscription","commits_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/merges","archive_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/downloads","issues_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/deployments","created_at":"2017-02-27T14:12:50Z","updated_at":"2018-06-13T15:47:23Z","pushed_at":"2018-06-13T15:54:56Z","git_url":"git://github.com/Financial-Times/n-myft-ui.git","ssh_url":"git@github.com:Financial-Times/n-myft-ui.git","clone_url":"https://github.com/Financial-Times/n-myft-ui.git","svn_url":"https://github.com/Financial-Times/n-myft-ui","homepage":"https://financial-times.github.io/n-myft-ui/index.html","size":419,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"Financial-Times:master","ref":"master","sha":"778f5c5116ba521958eaff2e80e67285453c51e0","user":{"login":"Financial-Times","id":3502508,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MDI1MDg=","avatar_url":"https://avatars1.githubusercontent.com/u/3502508?v=4","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":83317556,"node_id":"MDEwOlJlcG9zaXRvcnk4MzMxNzU1Ng==","name":"n-myft-ui","full_name":"Financial-Times/n-myft-ui","owner":{"login":"Financial-Times","id":3502508,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1MDI1MDg=","avatar_url":"https://avatars1.githubusercontent.com/u/3502508?v=4","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/n-myft-ui","description":"Client side component for interaction with myft","fork":false,"url":"https://api.github.com/repos/Financial-Times/n-myft-ui","forks_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/forks","keys_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/teams","hooks_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/events","assignees_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/tags","blobs_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/subscription","commits_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/merges","archive_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/downloads","issues_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/n-myft-ui/deployments","created_at":"2017-02-27T14:12:50Z","updated_at":"2018-06-13T15:47:23Z","pushed_at":"2018-06-13T15:54:56Z","git_url":"git://github.com/Financial-Times/n-myft-ui.git","ssh_url":"git@github.com:Financial-Times/n-myft-ui.git","clone_url":"https://github.com/Financial-Times/n-myft-ui.git","svn_url":"https://github.com/Financial-Times/n-myft-ui","homepage":"https://financial-times.github.io/n-myft-ui/index.html","size":419,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/n-myft-ui/pulls/169"},"html":{"href":"https://github.com/Financial-Times/n-myft-ui/pull/169"},"issue":{"href":"https://api.github.com/repos/Financial-Times/n-myft-ui/issues/169"},"comments":{"href":"https://api.github.com/repos/Financial-Times/n-myft-ui/issues/169/comments"},"review_comments":{"href":"https://api.github.com/repos/Financial-Times/n-myft-ui/pulls/169/comments"},"review_comment":{"href":"https://api.github.com/repos/Financial-Times/n-myft-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Financial-Times/n-myft-ui/pulls/169/commits"},"statuses":{"href":"https://api.github.com/repos/Financial-Times/n-myft-ui/statuses/6af434119cea9a20f8281868ea12630c52cbf305"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dan-searle"}}