update components
This commit is contained in:
parent
b4e32e14d4
commit
91127df6f0
21 changed files with 65 additions and 35 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-menu-behavior",
|
||||
"version": "1.1.7",
|
||||
"version": "1.1.8",
|
||||
"description": "Provides accessible menu behavior",
|
||||
"authors": "The Polymer Authors",
|
||||
"keywords": [
|
||||
|
@ -34,11 +34,11 @@
|
|||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"_release": "1.1.7",
|
||||
"_release": "1.1.8",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.1.7",
|
||||
"commit": "ea59e6ce5644d8f7a20c22f13f614ea60604a812"
|
||||
"tag": "v1.1.8",
|
||||
"commit": "3f6676b93a4592975efa235590b9d8236af6ea1d"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-menu-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
language: node_js
|
||||
sudo: required
|
||||
before_script:
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
env:
|
||||
global:
|
||||
- secure: QxZD8yzz7s3F6b7h87ztWYiEbD2TrQp1Z1mib5u1wL7EAwsrQVkFhIEo4cJPAsTGS98qgeZAITg0ifwp/jOKVC2QKoPnC1qjm4L0AjlhXBTRbqyS5G8jvfJ8M4DgkQXADh4e+lw9ba3h2AxceJELKTYaQVq/cpTrpPg0/RH7H4o=
|
||||
- secure: i76J23Bpwj6qJ4ybCCsQpGCTT+5s1PA+x0Avjbl1JTS4OsJLDFfvVl0YIWZ5xMIKJtdPC/mGDoZ2LNrh9hz82DBqDnzBlSnNjFbjnU1Aqy5CUmRWzyAF5NOjJGotISZcDYDGZd6gjsOfN0r+rICyRUiOadeyPf0Nm+6HSVQMjfM=
|
||||
- secure: CbYi/0VAtpLB+NDHdD/I9q2ldILrmyc3wxKdO5vEtMvRKYgsddQ/hXGovV3c6Hy9sAXD5sKtNi60BBG5E2XuydshjYAZiytfeNjFIvDu5627Xljjt90e/r1hg3tNHRRQihH73nPECfp/X+g+yBNCX3f0+2ExAh0DMs1DXt7Dl7Q=
|
||||
- secure: kLFlOTh9IjctY7DIJ3KEw5OPrqHNTzoArdabfAtisBMWahuJptKFmYCp/t+zPSL27IVqJakaqPrwGrBUi+4h3wVWredNhfl2lCpMfQfBMcHC5kBVkf2xjJyDa5Y3bP7jPq6YnWYAqEl6pBWYiHU6yWBc6BEdJ6FsTWFbLFTnY7w=
|
||||
node_js: stable
|
||||
addons:
|
||||
firefox: latest
|
||||
firefox: '46.0'
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
- google-chrome
|
||||
packages:
|
||||
- google-chrome-stable
|
||||
- google-chrome-stable
|
||||
sauce_connect: true
|
||||
script:
|
||||
- xvfb-run wct
|
||||
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
|
||||
- xvfb-run wct
|
||||
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct -s 'default'; fi
|
||||
dist: trusty
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
<!--
|
||||
This file is autogenerated based on
|
||||
https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
|
||||
|
@ -11,6 +10,7 @@ specific element:
|
|||
|
||||
jsbin=https://jsbin.com/cagaye/edit?html,output
|
||||
-->
|
||||
|
||||
# Polymer Elements
|
||||
## Guide for Contributors
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-menu-behavior",
|
||||
"version": "1.1.7",
|
||||
"version": "1.1.8",
|
||||
"description": "Provides accessible menu behavior",
|
||||
"authors": "The Polymer Authors",
|
||||
"keywords": [
|
||||
|
|
|
@ -139,11 +139,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
/**
|
||||
* Focuses the previous item (relative to the currently focused item) in the
|
||||
* menu, disabled items will be skipped.
|
||||
* Loop until length + 1 to handle case of single item in menu.
|
||||
*/
|
||||
_focusPrevious: function() {
|
||||
var length = this.items.length;
|
||||
var curFocusIndex = Number(this.indexOf(this.focusedItem));
|
||||
for (var i = 1; i < length; i++) {
|
||||
for (var i = 1; i < length + 1; i++) {
|
||||
var item = this.items[(curFocusIndex - i + length) % length];
|
||||
if (!item.hasAttribute('disabled')) {
|
||||
this._setFocusedItem(item);
|
||||
|
@ -155,11 +156,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
/**
|
||||
* Focuses the next item (relative to the currently focused item) in the
|
||||
* menu, disabled items will be skipped.
|
||||
* Loop until length + 1 to handle case of single item in menu.
|
||||
*/
|
||||
_focusNext: function() {
|
||||
var length = this.items.length;
|
||||
var curFocusIndex = Number(this.indexOf(this.focusedItem));
|
||||
for (var i = 1; i < length; i++) {
|
||||
for (var i = 1; i < length + 1; i++) {
|
||||
var item = this.items[(curFocusIndex + i) % length];
|
||||
if (!item.hasAttribute('disabled')) {
|
||||
this._setFocusedItem(item);
|
||||
|
|
|
@ -36,6 +36,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="single-item">
|
||||
<template>
|
||||
<test-menu>
|
||||
<div>item 1</div>
|
||||
</test-menu>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="disabled">
|
||||
<template>
|
||||
<test-menu>
|
||||
|
@ -101,6 +109,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
});
|
||||
});
|
||||
|
||||
test('first item gets focus when menu is focused in a single item menu', function(done) {
|
||||
var menu = fixture('single-item');
|
||||
MockInteractions.focus(menu);
|
||||
Polymer.Base.async(function() {
|
||||
var ownerRoot = Polymer.dom(menu.firstElementChild).getOwnerRoot() || document;
|
||||
var activeElement = Polymer.dom(ownerRoot).activeElement;
|
||||
assert.equal(activeElement, menu.firstElementChild, 'menu.firstElementChild is focused');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('selected item gets focus when menu is focused', function(done) {
|
||||
var menu = fixture('basic');
|
||||
menu.selected = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue