Thomas Bruederli
2014-05-07 d2bf33b242e9578fcb05bbf1365eeaf1d0dac67c
Forward keyboard event through 'menu-open' command to enable keyboard navigation
2 files modified
19 ■■■■■ changed files
program/js/app.js 2 ●●● patch | view | raw | blame | history
skins/larry/ui.js 17 ●●●●● patch | view | raw | blame | history
program/js/app.js
@@ -711,7 +711,7 @@
        }
      case 'menu-save':
        this.triggerEvent(command, {props:props});
        this.triggerEvent(command, {props:props, e:event});
        return false;
      case 'open':
skins/larry/ui.js
@@ -160,7 +160,10 @@
        // add menu link for each attachment
        $('#attachment-list > li').each(function() {
          $(this).append($('<a class="drop"></a>').click(function() { attachmentmenu(this); }));
          $(this).append($('<a class="drop" tabindex="0" aria-haspopup="true">Show options</a>')
              .click(function(e) { attachmentmenu(this, e); return false; })
              .keypress(function(e){ if (rcube_event.get_keycode(e) == 13) attachmentmenu(this, e); return false; })
          );
        });
        if (get_pref('previewheaders') == '1') {
@@ -491,7 +494,7 @@
    $('#message-objects div a').addClass('button');
    if (!$('#attachment-list li').length) {
      $('div.rightcol').hide();
      $('div.rightcol').hide().attr('aria-hidden', 'true');
      $('div.leftcol').css('margin-right', '0');
    }
  }
@@ -652,12 +655,12 @@
      ref.focus();
    }
    obj[show?'show':'hide']();
    obj[show?'show':'hide']().attr('aria-hidden', show?'false':'true');
    popup_keyboard_active = show && keyboard;
    if (popup_keyboard_active) {
      focused_popup = popup;
      obj.find('a,input').not('[aria-disabled=true]').first().focus();
      obj.find('a,input:not(:disabled)').not('[aria-disabled=true]').first().focus();
    }
    else {
      focused_popup = null;
@@ -819,7 +822,7 @@
  function menu_open(p)
  {
    if (p && p.props && p.props.menu == 'attachmentmenu')
      show_popupmenu('attachmentmenu');
      show_popupmenu('attachmentmenu', true, rcube_event.is_keyboard(p.e));
    else
      show_listoptions();
  }
@@ -863,7 +866,7 @@
    }
  }
  function attachmentmenu(elem)
  function attachmentmenu(elem, event)
  {
    var id = elem.parentNode.id.replace(/^attach/, '');
@@ -876,7 +879,7 @@
    });
    popupconfig.attachmentmenu.link = elem;
    rcmail.command('menu-open', {menu: 'attachmentmenu', id: id});
    rcmail.command('menu-open', {menu: 'attachmentmenu', id: id}, elem, event);
  }
  function spellmenu(show)