Skip to content

Commit

Permalink
Prevent page from scrolling to top when clicking languages button (#802)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngyikp authored and yangshun committed Jun 25, 2018
1 parent e4b9b98 commit 76870c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/core/nav/HeaderNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ class LanguageDropDown extends React.Component {
__html: `
const languagesMenuItem = document.getElementById("languages-menu");
const languagesDropDown = document.getElementById("languages-dropdown");
languagesMenuItem.addEventListener("click", function(){
if(languagesDropDown.className == "hide") {
languagesMenuItem.addEventListener("click", function(event) {
event.preventDefault();
if (languagesDropDown.className == "hide") {
languagesDropDown.className = "visible";
} else {
languagesDropDown.className = "hide";
Expand Down

0 comments on commit 76870c6

Please sign in to comment.