Skip to content

Commit 0430400

Browse files
committed
Fix dropdown not opening
- Removes *potentially* unnecessary js from the code - Closes a div in the index file
1 parent 26bc62a commit 0430400

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

guides/assets/javascripts/guides.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,6 @@
7979
// pressing escape, which is the standard key to collapse expanded elements.
8080
var guidesMenuButton = document.getElementById("guides-menu-button");
8181

82-
// The link is now acting as a button (but still allows for open in new tab).
83-
guidesMenuButton.setAttribute('role', 'button')
84-
guidesMenuButton.setAttribute('aria-controls', guidesMenuButton.getAttribute('data-aria-controls'));
85-
guidesMenuButton.setAttribute('aria-expanded', guidesMenuButton.getAttribute('data-aria-expanded'));
86-
guidesMenuButton.removeAttribute('data-aria-controls');
87-
guidesMenuButton.removeAttribute('data-aria-expanded');
88-
8982
var guides = document.getElementById(
9083
guidesMenuButton.getAttribute("aria-controls")
9184
);

guides/source/layout.html.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
<ul class="nav">
7979
<li><a class="nav-item" id="home_nav" href="https://rubyonrails.org/">Home</a></li>
8080
<li class="guides-index guides-index-large">
81-
<a href="index.html" id="guides-menu-button" data-aria-controls="guides" data-aria-expanded="false" class="guides-index-item nav-item">Guides Index</a>
81+
<a href="index.html" id="guides-menu-button" role="button" aria-controls="guides" aria-expanded="false" class="guides-index-item nav-item">Guides Index</a>
8282
<div id="guides" class="clearfix" style="display: none;">
8383
<hr />
8484
<dl class="guides-section-container">
@@ -161,6 +161,7 @@
161161
documentation is very welcome on the <%= link_to 'official Ruby on Rails Forum', 'https://discuss.rubyonrails.org/c/rubyonrails-docs' %>.
162162
</p>
163163
</footer>
164+
</div>
164165
</div>
165166
</article>
166167
</main>

0 commit comments

Comments
 (0)