Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b9846d9 authored by Scott Main's avatar Scott Main Committed by Android Git Automerger
Browse files

am f0093857: fix a couple bugs in sidenav for samples. Previously, clicking a...

am f0093857: fix a couple bugs in sidenav for samples. Previously, clicking a link still invoked the expand collapse behavior. Previously, collapsing a parent item did not also collapse its children.

* commit 'f0093857':
  fix a couple bugs in sidenav for samples. Previously, clicking a link still invoked the expand collapse behavior. Previously, collapsing a parent item did not also collapse its children.
parents a320b99a f0093857
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -449,13 +449,6 @@ false; // navigate across topic boundaries only in design docs
  }


  // Stop expand/collapse behavior when clicking on nav section links (since we're navigating away
  // from the page)
  $('.nav-section-header').find('a:eq(0)').click(function(evt) {
    window.location.href = $(this).attr('href');
    return false;
  });

  // Set up play-on-hover <video> tags.
  $('video.play-on-hover').bind('click', function(){
    $(this).get(0).load(); // in case the video isn't seekable
@@ -564,9 +557,11 @@ function initExpandableNavItems(rootTag) {
  $(rootTag + ' li.nav-section .nav-section-header').click(function() {
    var section = $(this).closest('li.nav-section');
    if (section.hasClass('expanded')) {
    /* hide me */
      section.children('ul').slideUp(250, function() {
    /* hide me and descendants */
      section.find('ul').slideUp(250, function() {
        // remove 'expanded' class from my section and any children
        section.closest('li').removeClass('expanded');
        $('li.nav-section', section).removeClass('expanded');
        resizeNav();
      });
    } else {
@@ -582,6 +577,14 @@ function initExpandableNavItems(rootTag) {
      });
    }
  });

  // Stop expand/collapse behavior when clicking on nav section links
  // (since we're navigating away from the page)
  // This selector captures the first instance of <a>, but not those with "#" as the href.
  $('.nav-section-header').find('a:eq(0)').not('a[href="#"]').click(function(evt) {
    window.location.href = $(this).attr('href');
    return false;
  });
}

function highlightSidenav() {