function toggleFocus() {
    var self = this;

    // Move up through the ancestors of the current link until we hit .nav-menu.
    while (-1 === self.className.indexOf("nav-menu")) {
      // On li elements toggle the class .focus.
      if ("li" === self.tagName.toLowerCase()) {
        if (-1 !== self.className.indexOf("focus")) {
          self.className = self.className.replace(" focus", "");
        } else {
          self.className += " focus";
        }
      }

      self = self.parentElement;
    }
  }
/**
   * Sets or removes .focus class on an element.
   */
Sets or removes .focus class on an element.
Sets or removes . focus class on an element .
function toggleFocus() {
    var self = this;
    while (-1 === self.className.indexOf("nav-menu")) {
      if ("li" === self.tagName.toLowerCase()) {
        if (-1 !== self.className.indexOf("focus")) {
          self.className = self.className.replace(" focus", "");
        } else {
          self.className += " focus";
        }
      }
      self = self.parentElement;
    }
  }
function toggleFocus ( ) { var self = this ; while ( - 1 === self . className . indexOf ( "nav-menu" ) ) { if ( "li" === self . tagName . toLowerCase ( ) ) { if ( - 1 !== self . className . indexOf ( "focus" ) ) { self . className = self . className . replace ( " focus" , "" ) ; } else { self . className += " focus" ; } } self = self . parentElement ; } }
Sets or removes .focus class on an element.
Sets or removes . focus class on an element .
// Move up through the ancestors of the current link until we hit .nav-menu. // On li elements toggle the class .focus.