mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update shared components
This commit is contained in:
parent
30db5a009c
commit
489dc97aab
33 changed files with 368 additions and 212 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-menu-behavior",
|
||||
"version": "1.1.6",
|
||||
"version": "1.1.7",
|
||||
"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.6",
|
||||
"_release": "1.1.7",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.1.6",
|
||||
"commit": "940c2769c7d6fefd5685e0200c3dfd0742c2a52f"
|
||||
"tag": "v1.1.7",
|
||||
"commit": "ea59e6ce5644d8f7a20c22f13f614ea60604a812"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-menu-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-menu-behavior",
|
||||
"version": "1.1.6",
|
||||
"version": "1.1.7",
|
||||
"description": "Provides accessible menu behavior",
|
||||
"authors": "The Polymer Authors",
|
||||
"keywords": [
|
||||
|
|
|
@ -128,7 +128,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
var attr = this.attrForItemTitle || 'textContent';
|
||||
var title = item[attr] || item.getAttribute(attr);
|
||||
|
||||
if (!item.hasAttribute('disabled') && title &&
|
||||
if (!item.hasAttribute('disabled') && title &&
|
||||
title.trim().charAt(0).toLowerCase() === String.fromCharCode(event.keyCode).toLowerCase()) {
|
||||
this._setFocusedItem(item);
|
||||
break;
|
||||
|
@ -209,17 +209,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
* detail.
|
||||
*/
|
||||
_onIronItemsChanged: function(event) {
|
||||
var mutations = event.detail;
|
||||
var mutation;
|
||||
var index;
|
||||
|
||||
for (index = 0; index < mutations.length; ++index) {
|
||||
mutation = mutations[index];
|
||||
|
||||
if (mutation.addedNodes.length) {
|
||||
this._resetTabindices();
|
||||
break;
|
||||
}
|
||||
if (event.detail.addedNodes.length) {
|
||||
this._resetTabindices();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -338,6 +338,47 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('`tabIndex` properties of all items are updated when items change', function(done) {
|
||||
var menu = fixture('basic');
|
||||
|
||||
function assertTabIndexCounts(nodes, expected) {
|
||||
var tabIndexCounts = {};
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var tabIndex = nodes[i].tabIndex;
|
||||
if (tabIndexCounts[tabIndex]) {
|
||||
tabIndexCounts[tabIndex]++;
|
||||
} else {
|
||||
tabIndexCounts[tabIndex] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
assert.equal(Object.keys(tabIndexCounts).length, Object.keys(expected).length);
|
||||
Object.keys(expected).forEach(function(key) {
|
||||
assert.equal(tabIndexCounts[key], expected[key]);
|
||||
});
|
||||
}
|
||||
|
||||
function divWithTabIndex(tabIndex) {
|
||||
var div = document.createElement('div');
|
||||
div.tabIndex = tabIndex;
|
||||
return div;
|
||||
}
|
||||
|
||||
// Only the selected item will have tabIndex 0.
|
||||
menu.select(0);
|
||||
assertTabIndexCounts(menu.items, {"-1": 2, "0": 1});
|
||||
|
||||
Polymer.dom(menu).appendChild(divWithTabIndex(1));
|
||||
Polymer.dom(menu).appendChild(divWithTabIndex(2));
|
||||
Polymer.dom(menu).appendChild(divWithTabIndex(3));
|
||||
|
||||
// Async wait for `observeNodes`.
|
||||
Polymer.Base.async(function() {
|
||||
assertTabIndexCounts(menu.items, {"-1": 5, "0": 1});
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue