{"action":"created","comment":{"url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/comments/80124989","id":80124989,"diff_hunk":"@@ -31,16 +27,30 @@ export class DocumentCard extends React.Component<IDocumentCardProps, any> {\n           css(\n             'ms-DocumentCard',\n             {\n-              'ms-DocumentCard--actionable': onClick ? true : false,\n+              'ms-DocumentCard--actionable': actionable,\n               'ms-DocumentCard--compact': type === DocumentCardType.compact ? true : false\n             },\n             className\n           )\n         }\n-        onClick={ onClick }\n+        onClick={ actionable ? this._onClick : null }\n         style={ style }>\n         { children }\n       </div>\n     );\n   }\n+\n+  @autobind\n+  private _onClick(ev: React.MouseEvent): void {\n+    let { onClick, onClickHref } = this.props;\n+\n+    if (onClick) {\n+      onClick(ev);\n+    } else if (!onClick && onClickHref) {\n+      // If no onClick Function was provided and we do have an onClickHref, redirect to the onClickHref\n+      window.location.href = onClickHref;","path":"src/components/DocumentCard/DocumentCard.tsx","position":49,"original_position":49,"commit_id":"ae09d99c0f1b107cfe9c4c14d54b7ef370c18184","original_commit_id":"ae09d99c0f1b107cfe9c4c14d54b7ef370c18184","user":{"login":"dzearing","id":1110944,"avatar_url":"https://avatars.githubusercontent.com/u/1110944?v=3","gravatar_id":"","url":"https://api.github.com/users/dzearing","html_url":"https://github.com/dzearing","followers_url":"https://api.github.com/users/dzearing/followers","following_url":"https://api.github.com/users/dzearing/following{/other_user}","gists_url":"https://api.github.com/users/dzearing/gists{/gist_id}","starred_url":"https://api.github.com/users/dzearing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzearing/subscriptions","organizations_url":"https://api.github.com/users/dzearing/orgs","repos_url":"https://api.github.com/users/dzearing/repos","events_url":"https://api.github.com/users/dzearing/events{/privacy}","received_events_url":"https://api.github.com/users/dzearing/received_events","type":"User","site_admin":false},"body":"A better approach would be  to create an anchor layer that is hosted within the div, and add a sibling to that anchor which overlays it, and contains the doc card stuff. That way, you aren't nesting anchors, but you can still make the card behave as an anchor with all the shift/ctrl click/status-bar-on-hover anchory goodness.\r\n","created_at":"2016-09-22T20:07:11Z","updated_at":"2016-09-22T20:08:17Z","html_url":"https://github.com/OfficeDev/office-ui-fabric-react/pull/298#discussion_r80124989","pull_request_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/298","_links":{"self":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/comments/80124989"},"html":{"href":"https://github.com/OfficeDev/office-ui-fabric-react/pull/298#discussion_r80124989"},"pull_request":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/298"}}},"pull_request":{"url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/298","id":85841895,"html_url":"https://github.com/OfficeDev/office-ui-fabric-react/pull/298","diff_url":"https://github.com/OfficeDev/office-ui-fabric-react/pull/298.diff","patch_url":"https://github.com/OfficeDev/office-ui-fabric-react/pull/298.patch","issue_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/issues/298","number":298,"state":"open","locked":false,"title":"Use private method instead of inline method in DocumentCard.","user":{"login":"yiminwu","id":9662034,"avatar_url":"https://avatars.githubusercontent.com/u/9662034?v=3","gravatar_id":"","url":"https://api.github.com/users/yiminwu","html_url":"https://github.com/yiminwu","followers_url":"https://api.github.com/users/yiminwu/followers","following_url":"https://api.github.com/users/yiminwu/following{/other_user}","gists_url":"https://api.github.com/users/yiminwu/gists{/gist_id}","starred_url":"https://api.github.com/users/yiminwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiminwu/subscriptions","organizations_url":"https://api.github.com/users/yiminwu/orgs","repos_url":"https://api.github.com/users/yiminwu/repos","events_url":"https://api.github.com/users/yiminwu/events{/privacy}","received_events_url":"https://api.github.com/users/yiminwu/received_events","type":"User","site_admin":false},"body":"This is to avoid create new function every time component is rerendered.","created_at":"2016-09-19T18:10:01Z","updated_at":"2016-09-22T20:08:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"42c77a5d4a621351629579ffe6a11c93a59db937","assignee":{"login":"dzearing","id":1110944,"avatar_url":"https://avatars.githubusercontent.com/u/1110944?v=3","gravatar_id":"","url":"https://api.github.com/users/dzearing","html_url":"https://github.com/dzearing","followers_url":"https://api.github.com/users/dzearing/followers","following_url":"https://api.github.com/users/dzearing/following{/other_user}","gists_url":"https://api.github.com/users/dzearing/gists{/gist_id}","starred_url":"https://api.github.com/users/dzearing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzearing/subscriptions","organizations_url":"https://api.github.com/users/dzearing/orgs","repos_url":"https://api.github.com/users/dzearing/repos","events_url":"https://api.github.com/users/dzearing/events{/privacy}","received_events_url":"https://api.github.com/users/dzearing/received_events","type":"User","site_admin":false},"assignees":[{"login":"dzearing","id":1110944,"avatar_url":"https://avatars.githubusercontent.com/u/1110944?v=3","gravatar_id":"","url":"https://api.github.com/users/dzearing","html_url":"https://github.com/dzearing","followers_url":"https://api.github.com/users/dzearing/followers","following_url":"https://api.github.com/users/dzearing/following{/other_user}","gists_url":"https://api.github.com/users/dzearing/gists{/gist_id}","starred_url":"https://api.github.com/users/dzearing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzearing/subscriptions","organizations_url":"https://api.github.com/users/dzearing/orgs","repos_url":"https://api.github.com/users/dzearing/repos","events_url":"https://api.github.com/users/dzearing/events{/privacy}","received_events_url":"https://api.github.com/users/dzearing/received_events","type":"User","site_admin":false},{"login":"mikewheaton","id":1382445,"avatar_url":"https://avatars.githubusercontent.com/u/1382445?v=3","gravatar_id":"","url":"https://api.github.com/users/mikewheaton","html_url":"https://github.com/mikewheaton","followers_url":"https://api.github.com/users/mikewheaton/followers","following_url":"https://api.github.com/users/mikewheaton/following{/other_user}","gists_url":"https://api.github.com/users/mikewheaton/gists{/gist_id}","starred_url":"https://api.github.com/users/mikewheaton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikewheaton/subscriptions","organizations_url":"https://api.github.com/users/mikewheaton/orgs","repos_url":"https://api.github.com/users/mikewheaton/repos","events_url":"https://api.github.com/users/mikewheaton/events{/privacy}","received_events_url":"https://api.github.com/users/mikewheaton/received_events","type":"User","site_admin":false},{"login":"yiminwu","id":9662034,"avatar_url":"https://avatars.githubusercontent.com/u/9662034?v=3","gravatar_id":"","url":"https://api.github.com/users/yiminwu","html_url":"https://github.com/yiminwu","followers_url":"https://api.github.com/users/yiminwu/followers","following_url":"https://api.github.com/users/yiminwu/following{/other_user}","gists_url":"https://api.github.com/users/yiminwu/gists{/gist_id}","starred_url":"https://api.github.com/users/yiminwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiminwu/subscriptions","organizations_url":"https://api.github.com/users/yiminwu/orgs","repos_url":"https://api.github.com/users/yiminwu/repos","events_url":"https://api.github.com/users/yiminwu/events{/privacy}","received_events_url":"https://api.github.com/users/yiminwu/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/298/commits","review_comments_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/298/comments","review_comment_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/issues/298/comments","statuses_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/statuses/ae09d99c0f1b107cfe9c4c14d54b7ef370c18184","head":{"label":"yiminwu:fix","ref":"fix","sha":"ae09d99c0f1b107cfe9c4c14d54b7ef370c18184","user":{"login":"yiminwu","id":9662034,"avatar_url":"https://avatars.githubusercontent.com/u/9662034?v=3","gravatar_id":"","url":"https://api.github.com/users/yiminwu","html_url":"https://github.com/yiminwu","followers_url":"https://api.github.com/users/yiminwu/followers","following_url":"https://api.github.com/users/yiminwu/following{/other_user}","gists_url":"https://api.github.com/users/yiminwu/gists{/gist_id}","starred_url":"https://api.github.com/users/yiminwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiminwu/subscriptions","organizations_url":"https://api.github.com/users/yiminwu/orgs","repos_url":"https://api.github.com/users/yiminwu/repos","events_url":"https://api.github.com/users/yiminwu/events{/privacy}","received_events_url":"https://api.github.com/users/yiminwu/received_events","type":"User","site_admin":false},"repo":{"id":64261724,"name":"office-ui-fabric-react","full_name":"yiminwu/office-ui-fabric-react","owner":{"login":"yiminwu","id":9662034,"avatar_url":"https://avatars.githubusercontent.com/u/9662034?v=3","gravatar_id":"","url":"https://api.github.com/users/yiminwu","html_url":"https://github.com/yiminwu","followers_url":"https://api.github.com/users/yiminwu/followers","following_url":"https://api.github.com/users/yiminwu/following{/other_user}","gists_url":"https://api.github.com/users/yiminwu/gists{/gist_id}","starred_url":"https://api.github.com/users/yiminwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiminwu/subscriptions","organizations_url":"https://api.github.com/users/yiminwu/orgs","repos_url":"https://api.github.com/users/yiminwu/repos","events_url":"https://api.github.com/users/yiminwu/events{/privacy}","received_events_url":"https://api.github.com/users/yiminwu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yiminwu/office-ui-fabric-react","description":"React components for building experiences for Office and Office 365.","fork":true,"url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react","forks_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/forks","keys_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/teams","hooks_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/hooks","issue_events_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/issues/events{/number}","events_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/events","assignees_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/assignees{/user}","branches_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/branches{/branch}","tags_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/tags","blobs_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/statuses/{sha}","languages_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/languages","stargazers_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/stargazers","contributors_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/contributors","subscribers_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/subscribers","subscription_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/subscription","commits_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/contents/{+path}","compare_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/merges","archive_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/downloads","issues_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/issues{/number}","pulls_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/pulls{/number}","milestones_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/milestones{/number}","notifications_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/labels{/name}","releases_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/releases{/id}","deployments_url":"https://api.github.com/repos/yiminwu/office-ui-fabric-react/deployments","created_at":"2016-07-26T23:34:10Z","updated_at":"2016-07-26T23:34:12Z","pushed_at":"2016-09-22T20:03:12Z","git_url":"git://github.com/yiminwu/office-ui-fabric-react.git","ssh_url":"git@github.com:yiminwu/office-ui-fabric-react.git","clone_url":"https://github.com/yiminwu/office-ui-fabric-react.git","svn_url":"https://github.com/yiminwu/office-ui-fabric-react","homepage":"http://dev.office.com/fabric","size":2487,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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":"OfficeDev:master","ref":"master","sha":"925b19538c48dcf6e781713a8b8ff9023f81bedb","user":{"login":"OfficeDev","id":6789362,"avatar_url":"https://avatars.githubusercontent.com/u/6789362?v=3","gravatar_id":"","url":"https://api.github.com/users/OfficeDev","html_url":"https://github.com/OfficeDev","followers_url":"https://api.github.com/users/OfficeDev/followers","following_url":"https://api.github.com/users/OfficeDev/following{/other_user}","gists_url":"https://api.github.com/users/OfficeDev/gists{/gist_id}","starred_url":"https://api.github.com/users/OfficeDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OfficeDev/subscriptions","organizations_url":"https://api.github.com/users/OfficeDev/orgs","repos_url":"https://api.github.com/users/OfficeDev/repos","events_url":"https://api.github.com/users/OfficeDev/events{/privacy}","received_events_url":"https://api.github.com/users/OfficeDev/received_events","type":"Organization","site_admin":false},"repo":{"id":60537144,"name":"office-ui-fabric-react","full_name":"OfficeDev/office-ui-fabric-react","owner":{"login":"OfficeDev","id":6789362,"avatar_url":"https://avatars.githubusercontent.com/u/6789362?v=3","gravatar_id":"","url":"https://api.github.com/users/OfficeDev","html_url":"https://github.com/OfficeDev","followers_url":"https://api.github.com/users/OfficeDev/followers","following_url":"https://api.github.com/users/OfficeDev/following{/other_user}","gists_url":"https://api.github.com/users/OfficeDev/gists{/gist_id}","starred_url":"https://api.github.com/users/OfficeDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OfficeDev/subscriptions","organizations_url":"https://api.github.com/users/OfficeDev/orgs","repos_url":"https://api.github.com/users/OfficeDev/repos","events_url":"https://api.github.com/users/OfficeDev/events{/privacy}","received_events_url":"https://api.github.com/users/OfficeDev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OfficeDev/office-ui-fabric-react","description":"React components for building experiences for Office and Office 365.","fork":false,"url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react","forks_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/forks","keys_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/teams","hooks_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/hooks","issue_events_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/issues/events{/number}","events_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/events","assignees_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/assignees{/user}","branches_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/branches{/branch}","tags_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/tags","blobs_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/statuses/{sha}","languages_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/languages","stargazers_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/stargazers","contributors_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/contributors","subscribers_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/subscribers","subscription_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/subscription","commits_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/contents/{+path}","compare_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/merges","archive_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/downloads","issues_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/issues{/number}","pulls_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls{/number}","milestones_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/milestones{/number}","notifications_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/labels{/name}","releases_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/releases{/id}","deployments_url":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/deployments","created_at":"2016-06-06T15:03:44Z","updated_at":"2016-09-22T18:09:48Z","pushed_at":"2016-09-22T20:03:12Z","git_url":"git://github.com/OfficeDev/office-ui-fabric-react.git","ssh_url":"git@github.com:OfficeDev/office-ui-fabric-react.git","clone_url":"https://github.com/OfficeDev/office-ui-fabric-react.git","svn_url":"https://github.com/OfficeDev/office-ui-fabric-react","homepage":"http://dev.office.com/fabric","size":3519,"stargazers_count":124,"watchers_count":124,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":51,"mirror_url":null,"open_issues_count":59,"forks":51,"open_issues":59,"watchers":124,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/298"},"html":{"href":"https://github.com/OfficeDev/office-ui-fabric-react/pull/298"},"issue":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/issues/298"},"comments":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/issues/298/comments"},"review_comments":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/298/comments"},"review_comment":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/pulls/298/commits"},"statuses":{"href":"https://api.github.com/repos/OfficeDev/office-ui-fabric-react/statuses/ae09d99c0f1b107cfe9c4c14d54b7ef370c18184"}}}}
{"actor":{"display_login":"dzearing"}}