{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/teach.mozilla.org/pulls/comments/46498850","id":46498850,"diff_hunk":"@@ -5,27 +5,85 @@ var LinkAnchorSwap = require('./link-anchor-swap.jsx');\n \n var Login = require('./login.jsx');\n \n+var Subitems = React.createClass({\n+  render: function() {\n+    var items = this.props.subItems.map(function (item, key) {\n+      return (\n+        <li key={item.name}>\n+          <Link to={item.link}>\n+            {item.name}\n+          </Link>\n+        </li>\n+      )}\n+    );\n+    return (\n+      <ul className=\"sidebar-subitems\">\n+        {items}\n+      </ul>\n+    );\n+  }\n+});\n+\n+var TopLevelNavItem = React.createClass({\n+  getInitialState: function() {\n+    return {\n+      activeSubNav: false\n+    };\n+  },\n+  componentDidMount: function() {\n+    this.highlightActiveSubNav();\n+  },\n+  componentDidUpdate: function() {\n+    this.highlightActiveSubNav();\n+  },\n+  highlightActiveSubNav: function() {\n+    var activeState = !!this.getDOMNode().querySelector(\".sidebar-subitems a.active\");","path":"components/sidebar.jsx","position":36,"original_position":36,"commit_id":"c0850698dfc7a939e2c9f2bcd37692dd4dc9e40a","original_commit_id":"c0850698dfc7a939e2c9f2bcd37692dd4dc9e40a","user":{"login":"Pomax","id":177243,"avatar_url":"https://avatars.githubusercontent.com/u/177243?v=3","gravatar_id":"","url":"https://api.github.com/users/Pomax","html_url":"https://github.com/Pomax","followers_url":"https://api.github.com/users/Pomax/followers","following_url":"https://api.github.com/users/Pomax/following{/other_user}","gists_url":"https://api.github.com/users/Pomax/gists{/gist_id}","starred_url":"https://api.github.com/users/Pomax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pomax/subscriptions","organizations_url":"https://api.github.com/users/Pomax/orgs","repos_url":"https://api.github.com/users/Pomax/repos","events_url":"https://api.github.com/users/Pomax/events{/privacy}","received_events_url":"https://api.github.com/users/Pomax/received_events","type":"User","site_admin":false},"body":"the fact that we need DOM querying here is a sign we're doing something wrong. React doesn't need DOM queries for anything, if done right; this should be a thing we can simply ask the relevant `this.refs` component. What does this code achieve, and can we do that \"directly\"?","created_at":"2015-12-03T00:37:45Z","updated_at":"2015-12-03T00:37:45Z","html_url":"https://github.com/mozilla/teach.mozilla.org/pull/1455#discussion_r46498850","pull_request_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/pulls/1455","_links":{"self":{"href":"https://api.github.com/repos/mozilla/teach.mozilla.org/pulls/comments/46498850"},"html":{"href":"https://github.com/mozilla/teach.mozilla.org/pull/1455#discussion_r46498850"},"pull_request":{"href":"https://api.github.com/repos/mozilla/teach.mozilla.org/pulls/1455"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/teach.mozilla.org/pulls/1455","id":52030587,"html_url":"https://github.com/mozilla/teach.mozilla.org/pull/1455","diff_url":"https://github.com/mozilla/teach.mozilla.org/pull/1455.diff","patch_url":"https://github.com/mozilla/teach.mozilla.org/pull/1455.patch","issue_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/issues/1455","number":1455,"state":"open","locked":false,"title":"Simplified sidebar","user":{"login":"mmmavis","id":2896608,"avatar_url":"https://avatars.githubusercontent.com/u/2896608?v=3","gravatar_id":"","url":"https://api.github.com/users/mmmavis","html_url":"https://github.com/mmmavis","followers_url":"https://api.github.com/users/mmmavis/followers","following_url":"https://api.github.com/users/mmmavis/following{/other_user}","gists_url":"https://api.github.com/users/mmmavis/gists{/gist_id}","starred_url":"https://api.github.com/users/mmmavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmmavis/subscriptions","organizations_url":"https://api.github.com/users/mmmavis/orgs","repos_url":"https://api.github.com/users/mmmavis/repos","events_url":"https://api.github.com/users/mmmavis/events{/privacy}","received_events_url":"https://api.github.com/users/mmmavis/received_events","type":"User","site_admin":false},"body":"Fixes #1397 ","created_at":"2015-11-28T01:19:25Z","updated_at":"2015-12-03T00:37:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b6bdb3b917770b0450ca23356b0563b255b3df2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/pulls/1455/commits","review_comments_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/pulls/1455/comments","review_comment_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/issues/1455/comments","statuses_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/statuses/c0850698dfc7a939e2c9f2bcd37692dd4dc9e40a","head":{"label":"mmmavis:issue-1397-simplified-sidebar","ref":"issue-1397-simplified-sidebar","sha":"c0850698dfc7a939e2c9f2bcd37692dd4dc9e40a","user":{"login":"mmmavis","id":2896608,"avatar_url":"https://avatars.githubusercontent.com/u/2896608?v=3","gravatar_id":"","url":"https://api.github.com/users/mmmavis","html_url":"https://github.com/mmmavis","followers_url":"https://api.github.com/users/mmmavis/followers","following_url":"https://api.github.com/users/mmmavis/following{/other_user}","gists_url":"https://api.github.com/users/mmmavis/gists{/gist_id}","starred_url":"https://api.github.com/users/mmmavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmmavis/subscriptions","organizations_url":"https://api.github.com/users/mmmavis/orgs","repos_url":"https://api.github.com/users/mmmavis/repos","events_url":"https://api.github.com/users/mmmavis/events{/privacy}","received_events_url":"https://api.github.com/users/mmmavis/received_events","type":"User","site_admin":false},"repo":{"id":31672902,"name":"teach.mozilla.org","full_name":"mmmavis/teach.mozilla.org","owner":{"login":"mmmavis","id":2896608,"avatar_url":"https://avatars.githubusercontent.com/u/2896608?v=3","gravatar_id":"","url":"https://api.github.com/users/mmmavis","html_url":"https://github.com/mmmavis","followers_url":"https://api.github.com/users/mmmavis/followers","following_url":"https://api.github.com/users/mmmavis/following{/other_user}","gists_url":"https://api.github.com/users/mmmavis/gists{/gist_id}","starred_url":"https://api.github.com/users/mmmavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmmavis/subscriptions","organizations_url":"https://api.github.com/users/mmmavis/orgs","repos_url":"https://api.github.com/users/mmmavis/repos","events_url":"https://api.github.com/users/mmmavis/events{/privacy}","received_events_url":"https://api.github.com/users/mmmavis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mmmavis/teach.mozilla.org","description":"This repo is for tracking initiatives of the Mozilla Learning Networks team.","fork":true,"url":"https://api.github.com/repos/mmmavis/teach.mozilla.org","forks_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/forks","keys_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/teams","hooks_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/hooks","issue_events_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/issues/events{/number}","events_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/events","assignees_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/assignees{/user}","branches_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/branches{/branch}","tags_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/tags","blobs_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/statuses/{sha}","languages_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/languages","stargazers_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/stargazers","contributors_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/contributors","subscribers_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/subscribers","subscription_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/subscription","commits_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/contents/{+path}","compare_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/merges","archive_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/downloads","issues_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/issues{/number}","pulls_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/pulls{/number}","milestones_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/milestones{/number}","notifications_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/labels{/name}","releases_url":"https://api.github.com/repos/mmmavis/teach.mozilla.org/releases{/id}","created_at":"2015-03-04T18:30:27Z","updated_at":"2015-09-21T19:16:22Z","pushed_at":"2015-12-02T03:35:22Z","git_url":"git://github.com/mmmavis/teach.mozilla.org.git","ssh_url":"git@github.com:mmmavis/teach.mozilla.org.git","clone_url":"https://github.com/mmmavis/teach.mozilla.org.git","svn_url":"https://github.com/mmmavis/teach.mozilla.org","homepage":"http://mozilla-learning-html.s3-website-us-east-1.amazonaws.com/","size":103966,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"mozilla:develop","ref":"develop","sha":"ea6d6a6ca771da35a53bf138970fe58927818bfa","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":30430269,"name":"teach.mozilla.org","full_name":"mozilla/teach.mozilla.org","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/teach.mozilla.org","description":"This repo is for tracking initiatives of the Mozilla Learning Networks team.","fork":false,"url":"https://api.github.com/repos/mozilla/teach.mozilla.org","forks_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/forks","keys_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/teams","hooks_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/hooks","issue_events_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/events","assignees_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/tags","blobs_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/languages","stargazers_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/stargazers","contributors_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/contributors","subscribers_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/subscribers","subscription_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/subscription","commits_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/merges","archive_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/downloads","issues_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/teach.mozilla.org/releases{/id}","created_at":"2015-02-06T19:54:24Z","updated_at":"2015-12-02T14:25:51Z","pushed_at":"2015-12-02T03:35:22Z","git_url":"git://github.com/mozilla/teach.mozilla.org.git","ssh_url":"git@github.com:mozilla/teach.mozilla.org.git","clone_url":"https://github.com/mozilla/teach.mozilla.org.git","svn_url":"https://github.com/mozilla/teach.mozilla.org","homepage":"https://teach.mozilla.org","size":107366,"stargazers_count":21,"watchers_count":21,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":58,"mirror_url":null,"open_issues_count":163,"forks":58,"open_issues":163,"watchers":21,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/teach.mozilla.org/pulls/1455"},"html":{"href":"https://github.com/mozilla/teach.mozilla.org/pull/1455"},"issue":{"href":"https://api.github.com/repos/mozilla/teach.mozilla.org/issues/1455"},"comments":{"href":"https://api.github.com/repos/mozilla/teach.mozilla.org/issues/1455/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/teach.mozilla.org/pulls/1455/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/teach.mozilla.org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/teach.mozilla.org/pulls/1455/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/teach.mozilla.org/statuses/c0850698dfc7a939e2c9f2bcd37692dd4dc9e40a"}}}}