<commit_before>(function($) {

  var focusClass = 'focused';

  /*
    Plugin to create nav menus, show/hide delays, etc.
    Accessible by keyboard too!
  */
  $.fn.mozMenu = function(options) {

    var settings = $.extend({
      showDelay: 100,
      hideDelay: 100,
      submenu: null,
      focusOnOpen: false,
      brickOnClick: false,
      onOpen: function(){},
      onClose: function() {}
    }, options);

    var closeTimeout;
    var showTimeout;

    return $(this).each(function() {
      var $self = $(this);
      var $li = $self.parent();
      var initialized;

      // Brick on click?
      var brick = settings.brickOnClick;
      if(brick) {
        $self.on('click', function(e) {
          if(typeof brick != 'function' || brick(e)) e.preventDefault();
        });
      }

      // Find a submenu.  If one doesn't exist, no need to go further
      var $submenu = (settings.submenu || $li.find('.submenu'));

      // ARIA: Initialize as closed, tell if there's a submenu
      $self.attr('aria-expanded', 'false');

      if($submenu.length) {
        $self.attr({
          'aria-expanded': 'false',
          'aria-haspopup': 'true'
        });
      }<commit_msg>don't add aria-expanded to all the navigational links, just the ones with a submenu.<commit_after>(function($) {

  var focusClass = 'focused';

  /*
    Plugin to create nav menus, show/hide delays, etc.
    Accessible by keyboard too!
  */
  $.fn.mozMenu = function(options) {

    var settings = $.extend({
      showDelay: 100,
      hideDelay: 100,
      submenu: null,
      focusOnOpen: false,
      brickOnClick: false,
      onOpen: function(){},
      onClose: function() {}
    }, options);

    var closeTimeout;
    var showTimeout;

    return $(this).each(function() {
      var $self = $(this);
      var $li = $self.parent();
      var initialized;

      // Brick on click?
      var brick = settings.brickOnClick;
      if(brick) {
        $self.on('click', function(e) {
          if(typeof brick != 'function' || brick(e)) e.preventDefault();
        });
      }

      // Find a submenu.  If one doesn't exist, no need to go further
      var $submenu = (settings.submenu || $li.find('.submenu'));

      // add some ARIA
      if($submenu.length) {
        $self.attr({
          'aria-expanded': 'false',
          'aria-haspopup': 'true'
        });
      }
{'fraction_non_alphanumeric': 0.1471825063078217, 'fraction_numerical': 0.005046257359125316, 'mean_word_length': 2.142668428005284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7534375', 'n_tokens_mistral': 761, 'n_tokens_neox': 726, 'n_words': 199}