3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 Code distributed by Google as part of the polymer project is also
8 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
11 <link rel=
"import" href=
"../polymer/polymer.html">
12 <link rel=
"import" href=
"iron-menu-behavior.html">
17 * `Polymer.IronMenubarBehavior` implements accessible menubar behavior.
19 * @polymerBehavior Polymer.IronMenubarBehavior
21 Polymer
.IronMenubarBehaviorImpl
= {
29 'right': '_onRightKey'
32 _onUpKey: function(event
) {
33 this._activateFocused(event
.detail
.keyboardEvent
);
36 _onDownKey: function(event
) {
37 this._activateFocused(event
.detail
.keyboardEvent
);
40 _onLeftKey: function() {
41 this._focusPrevious();
44 _onRightKey: function() {
48 _onKeydown: function(event
) {
49 if (this.keyboardEventMatchesKeys(event
, 'up down left right esc enter')) {
53 // all other keys focus the menu item starting with that character
54 this._focusWithKeyboardEvent(event
);
59 /** @polymerBehavior Polymer.IronMenubarBehavior */
60 Polymer
.IronMenubarBehavior
= [
61 Polymer
.IronMenuBehavior
,
62 Polymer
.IronMenubarBehaviorImpl