mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
78e572f2fc
commit
038bf83aef
20 changed files with 160 additions and 25 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-selector",
|
||||
"version": "1.4.0",
|
||||
"version": "1.5.0",
|
||||
"description": "Manages a set of elements that can be selected",
|
||||
"private": true,
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
|
@ -30,13 +30,13 @@
|
|||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"_release": "1.4.0",
|
||||
"_release": "1.5.0",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.4.0",
|
||||
"commit": "554f7418fdbd97688eb21518b5f8172167d53a95"
|
||||
"tag": "v1.5.0",
|
||||
"commit": "c7402274efa2e3b2a905ffa25d70c2ff3309dc59"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-selector.git",
|
||||
"_source": "git://github.com/polymerelements/iron-selector.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "PolymerElements/iron-selector"
|
||||
"_originalSource": "polymerelements/iron-selector"
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
language: node_js
|
||||
sudo: false
|
||||
sudo: required
|
||||
before_script:
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
|
@ -8,18 +8,16 @@ env:
|
|||
global:
|
||||
- secure: ltCkwJM0nkTS9WjikyjqBsB5J2hQon4UnVVrINk4y+Vq4v9PQJH3+83nya0jnxilKaeAJs4d2/OS02F9GkqYpsSmDz7OgXPfk0hrHA8UksvvpSALfnukleIAN2YTOcxXJKeNHcfpqCKPk1dGeNQOEM61H+QgTBIyFB3sMugygqs=
|
||||
- secure: TJuu1WdpFLTaBN/prBafm8Pld/BQCySNuuG1nATbF3fqiOpgehXu8Z5URAz5syUhqZAyEmuRMxvXpEVD/t1jrtaXVwkdCFkkQ4ckkP4gTIeSGA/Puw8sveB2q7QAqXyTmeFkocNlh8fxV+B07o0SPWdhcvdZnDVU9VrpSqL+92M=
|
||||
- CXX=g++-4.8
|
||||
node_js: stable
|
||||
addons:
|
||||
firefox: latest
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- google-chrome-stable
|
||||
- g++-4.8
|
||||
sauce_connect: true
|
||||
script:
|
||||
- xvfb-run wct
|
||||
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
|
||||
dist: trusty
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-selector",
|
||||
"version": "1.4.0",
|
||||
"version": "1.5.0",
|
||||
"description": "Manages a set of elements that can be selected",
|
||||
"private": true,
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
|
|
|
@ -220,6 +220,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
this.selected = this._indexToValue(index);
|
||||
},
|
||||
|
||||
/**
|
||||
* Selects the item at the given index.
|
||||
*
|
||||
* @method selectIndex
|
||||
*/
|
||||
selectIndex: function(index) {
|
||||
this.select(this._indexToValue(index));
|
||||
},
|
||||
|
||||
/**
|
||||
* Force a synchronous update of the `items` property.
|
||||
*
|
||||
|
|
|
@ -154,6 +154,35 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
expect(s2.items.length).to.be.equal(6);
|
||||
});
|
||||
|
||||
suite('`select()` and `selectIndex()`', function() {
|
||||
test('`select()` selects an item with the given value', function() {
|
||||
s2.select('item1');
|
||||
assert.equal(s2.selected, 'item1');
|
||||
|
||||
s2.select('item3');
|
||||
assert.equal(s2.selected, 'item3');
|
||||
|
||||
s2.select('item2');
|
||||
assert.equal(s2.selected, 'item2');
|
||||
});
|
||||
|
||||
test('`selectIndex()` selects an item with the given index', function() {
|
||||
assert.equal(s2.selectedItem, undefined);
|
||||
|
||||
s2.selectIndex(1);
|
||||
assert.equal(s2.selected, 'item1');
|
||||
assert.equal(s2.selectedItem, s2.items[1]);
|
||||
|
||||
s2.selectIndex(3);
|
||||
assert.equal(s2.selected, 'item3');
|
||||
assert.equal(s2.selectedItem, s2.items[3]);
|
||||
|
||||
s2.selectIndex(4);
|
||||
assert.equal(s2.selected, 'item4');
|
||||
assert.equal(s2.selectedItem, s2.items[4]);
|
||||
});
|
||||
});
|
||||
|
||||
suite('items changing', function() {
|
||||
var s1;
|
||||
|
||||
|
|
|
@ -45,6 +45,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="valueById">
|
||||
<template>
|
||||
<iron-selector multi attr-for-selected="id">
|
||||
<div id="item0">Item 0</div>
|
||||
<div id="item1">Item 1</div>
|
||||
<div id="item2">Item 2</div>
|
||||
<div id="item3">Item 3</div>
|
||||
<div id="item4">Item 4</div>
|
||||
</iron-selector>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<!--
|
||||
NOTE(cdata): Enable test-fixture when polymer/polymer#2495 is resolved
|
||||
-->
|
||||
|
@ -301,6 +313,48 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
});
|
||||
|
||||
suite('`select()` and `selectIndex()`', function() {
|
||||
var selector;
|
||||
|
||||
setup(function() {
|
||||
selector = fixture('valueById');
|
||||
});
|
||||
|
||||
test('`select()` selects an item with the given value', function() {
|
||||
selector.select('item1');
|
||||
assert.equal(selector.selectedValues.length, 1);
|
||||
assert.equal(selector.selectedValues.indexOf('item1'), 0);
|
||||
|
||||
selector.select('item3');
|
||||
assert.equal(selector.selectedValues.length, 2);
|
||||
assert.isTrue(selector.selectedValues.indexOf('item3') >= 0);
|
||||
|
||||
selector.select('item2');
|
||||
assert.equal(selector.selectedValues.length, 3);
|
||||
assert.isTrue(selector.selectedValues.indexOf('item2') >= 0);
|
||||
});
|
||||
|
||||
test('`selectIndex()` selects an item with the given index', function() {
|
||||
selector.selectIndex(1);
|
||||
assert.equal(selector.selectedValues.length, 1);
|
||||
assert.isTrue(selector.selectedValues.indexOf('item1') >= 0);
|
||||
assert.equal(selector.selectedItems.length, 1);
|
||||
assert.isTrue(selector.selectedItems.indexOf(selector.items[1]) >= 0);
|
||||
|
||||
selector.selectIndex(3);
|
||||
assert.equal(selector.selectedValues.length, 2);
|
||||
assert.isTrue(selector.selectedValues.indexOf('item3') >= 0);
|
||||
assert.equal(selector.selectedItems.length, 2);
|
||||
assert.isTrue(selector.selectedItems.indexOf(selector.items[3]) >= 0);
|
||||
|
||||
selector.selectIndex(0);
|
||||
assert.equal(selector.selectedValues.length, 3);
|
||||
assert.isTrue(selector.selectedValues.indexOf('item0') >= 0);
|
||||
assert.equal(selector.selectedItems.length, 3);
|
||||
assert.isTrue(selector.selectedItems.indexOf(selector.items[0]) >= 0);
|
||||
});
|
||||
});
|
||||
|
||||
/* test('toggle multi from true to false', function() {
|
||||
// set selected
|
||||
s.selected = [0, 2];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue