{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/37767034","id":37767034,"diff_hunk":"@@ -0,0 +1,73 @@\n+var edx = edx || {},\n+\n+    Navigation = (function() {\n+\n+        var navigation = {\n+\n+            init: function() {\n+\n+                if ($('#accordion').length) {\n+\n+                    navigation.openAccordion();\n+                }\n+            },\n+\n+            openAccordion: function() {\n+                $('#open_close_accordion a').click();\n+                $('.course-wrapper').removeClass('closed');\n+                $('#accordion').show();\n+\n+                navigation.checkForCurrent();\n+                navigation.listenForClick();\n+            },\n+\n+            checkForCurrent: function() {\n+                var active = $('#accordion div div:has(a.active)').index('#accordion div div') ? $('#accordion div div:has(a.active)').index('#accordion div div') : 0;\n+\n+                $('#accordion .button-chapter:eq(' + active + ')').trigger('click');\n+            },\n+\n+            listenForClick: function() {\n+                $('#accordion').on('click', '.button-chapter', function(event) {\n+                    navigation.resetAllAccordions();\n+                    navigation.openAccordionSection(event.currentTarget);\n+                    navigation.setAriaAttrs(event.currentTarget);\n+                });\n+            },\n+\n+            resetAllAccordions: function() {\n+                $('.chapter-content-container').hide();\n+                $('.chapter-content-container .chapter-menu').hide();\n+\n+                $('#accordion .button-chapter').each(function(event) {\n+                    $(this).removeClass('is-open').attr('aria-pressed', 'false');\n+                    $(this).next('.chapter-content-container').attr('aria-expanded', 'false');\n+                    $(this).children('.group-heading').removeClass('active');\n+                    $(this).children('.group-heading').find('.icon').addClass('fa-caret-right').removeClass('fa-caret-down');\n+                });\n+            },\n+\n+            openAccordionSection: function(section) {\n+                $(section).next('.chapter-content-container').show().focus();\n+                $(section).next('.chapter-content-container').find('.chapter-menu').show();\n+\n+                navigation.setAriaAttrs(section);\n+            },\n+\n+            setAriaAttrs: function(section) {\n+                $(section).addClass('is-open').attr('aria-pressed', 'true');\n+                $(section).next('.chapter-content-container').attr('aria-expanded', 'true');\n+                $(section).children('.group-heading').addClass('active');\n+                $(section).children('.group-heading').find('.icon').removeClass('fa-caret-right').addClass('fa-caret-down');\n+            }","path":"lms/static/js/utils/navigation.js","position":62,"original_position":62,"commit_id":"e9f3e6eadc7f0204335f8ed22033425a78ae05cc","original_commit_id":"e9f3e6eadc7f0204335f8ed22033425a78ae05cc","user":{"login":"AlasdairSwan","id":2052185,"avatar_url":"https://avatars.githubusercontent.com/u/2052185?v=3","gravatar_id":"","url":"https://api.github.com/users/AlasdairSwan","html_url":"https://github.com/AlasdairSwan","followers_url":"https://api.github.com/users/AlasdairSwan/followers","following_url":"https://api.github.com/users/AlasdairSwan/following{/other_user}","gists_url":"https://api.github.com/users/AlasdairSwan/gists{/gist_id}","starred_url":"https://api.github.com/users/AlasdairSwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlasdairSwan/subscriptions","organizations_url":"https://api.github.com/users/AlasdairSwan/orgs","repos_url":"https://api.github.com/users/AlasdairSwan/repos","events_url":"https://api.github.com/users/AlasdairSwan/events{/privacy}","received_events_url":"https://api.github.com/users/AlasdairSwan/received_events","type":"User","site_admin":false},"body":"This function does a opposite of liens 43-46, it would make sense to have 2 functions with more meaningful names that take an element and open or close the accordion element","created_at":"2015-08-24T15:55:20Z","updated_at":"2015-08-24T15:55:20Z","html_url":"https://github.com/edx/edx-platform/pull/9367#discussion_r37767034","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/9367","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/37767034"},"html":{"href":"https://github.com/edx/edx-platform/pull/9367#discussion_r37767034"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/9367"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/9367","id":42739122,"html_url":"https://github.com/edx/edx-platform/pull/9367","diff_url":"https://github.com/edx/edx-platform/pull/9367.diff","patch_url":"https://github.com/edx/edx-platform/pull/9367.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/9367","number":9367,"state":"open","locked":false,"title":"Course navigation menu accessibility issue","user":{"login":"clrux","id":2112024,"avatar_url":"https://avatars.githubusercontent.com/u/2112024?v=3","gravatar_id":"","url":"https://api.github.com/users/clrux","html_url":"https://github.com/clrux","followers_url":"https://api.github.com/users/clrux/followers","following_url":"https://api.github.com/users/clrux/following{/other_user}","gists_url":"https://api.github.com/users/clrux/gists{/gist_id}","starred_url":"https://api.github.com/users/clrux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clrux/subscriptions","organizations_url":"https://api.github.com/users/clrux/orgs","repos_url":"https://api.github.com/users/clrux/repos","events_url":"https://api.github.com/users/clrux/events{/privacy}","received_events_url":"https://api.github.com/users/clrux/received_events","type":"User","site_admin":false},"body":"This work relates to [AC-76](https://openedx.atlassian.net/browse/AC-76) continues where Ahsan left off. It combines styling work I completed earlier (included in this branch) with structural work from Ahsan. According to the previous (now closed) PR the following have been done:\r\n* Change the structure of the course navigation Menu HTML\r\n* Add some basic styling\r\n* Add basic JS for html rendering\r\n* Update tests according to new structure\r\n\r\n## Browsers\r\n\r\nThis work was checked in the following browsers:\r\n\r\n| Platform | Browser | Version | Passed |\r\n|----------|---------|---------|--------|\r\n| Mac      | Chrome  | 43      | Yes    |\r\n|          | Safari  | 8       | Yes    |\r\n|          | Firefox | 24      | Yes    |\r\n| Windows  | Chrome  | 43      | Yes    |\r\n|          | Firefox | 38      | Yes    |\r\n|          | IE      | 10      | Yes    |\r\n|          | IE      | 11      | Yes    |\r\n\r\n## Sandbox\r\n\r\nNo sandbox yet.\r\n\r\n## Reviewers\r\n\r\nThe following reviewers need to provide thumbs before this work can be merged.\r\n\r\n- [ ] @cptvitamin (Accessibility)\r\n- [ ] @talbs (FED/Sass)\r\n- [ ] @AlasdairSwan (JS)\r\n\r\n### Notes to the reviewers\r\n\r\n__Mark__\r\nVoiceOver in Chrome still announces the incorrect number of items, despite converting the `li`'s to normal `a`'s within the `nav`. Otherwise, his reads much clearer than before and has correct focus management.\r\n\r\nI moved the `aria-expanded` from the button to the actual container that's expanded. It seems to read okay with screen readers.\r\n\r\n__Brian__\r\nStyles should look pretty much like they did before with very few exceptions. I ditched the slide transitions because it wasn't allowing focus to be sent (race condition). Let me know your thoughts on overall styles.\r\n\r\n__Alasdair__\r\nI tried to emulate the standards from the dropdown menu we briefly worked on a few months ago. I've re-written the course nav code to be JavaScript/jQuery rather than CoffeeScript and removed all references of the the latter. I've also made this use RequireJS for better management later.\r\n\r\nOne question I did have was how to properly include this file. It will be included everywhere in courseware (that has sections and units) within the LMS. Advice is welcome and thank you in advance.","created_at":"2015-08-18T19:34:50Z","updated_at":"2015-08-24T15:55:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"acc99d4faa5b3357e4fac9376945fc01a846d203","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/9367/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/9367/comments","review_comment_url":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/9367/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/e9f3e6eadc7f0204335f8ed22033425a78ae05cc","head":{"label":"edx:clrux/ac-76-course-nav","ref":"clrux/ac-76-course-nav","sha":"e9f3e6eadc7f0204335f8ed22033425a78ae05cc","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","created_at":"2013-05-30T20:20:38Z","updated_at":"2015-08-20T21:51:37Z","pushed_at":"2015-08-24T15:40:52Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://open.edx.org/","size":2095603,"stargazers_count":2086,"watchers_count":2086,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1226,"mirror_url":null,"open_issues_count":149,"forks":1226,"open_issues":149,"watchers":2086,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"689efedeee47cf15642af259ec47485610ee9418","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","created_at":"2013-05-30T20:20:38Z","updated_at":"2015-08-20T21:51:37Z","pushed_at":"2015-08-24T15:40:52Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://open.edx.org/","size":2095603,"stargazers_count":2086,"watchers_count":2086,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1226,"mirror_url":null,"open_issues_count":149,"forks":1226,"open_issues":149,"watchers":2086,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/9367"},"html":{"href":"https://github.com/edx/edx-platform/pull/9367"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/9367"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/9367/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/9367/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/9367/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/e9f3e6eadc7f0204335f8ed22033425a78ae05cc"}}}}