mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update polymer
This commit is contained in:
parent
6825ae319e
commit
2d53ff29c5
106 changed files with 3070 additions and 1567 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-a11y-keys-behavior",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"description": "A behavior that enables keybindings for greater a11y.",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
|
@ -29,14 +29,14 @@
|
|||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/polymerelements/iron-a11y-keys-behavior",
|
||||
"_release": "1.0.6",
|
||||
"homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior",
|
||||
"_release": "1.0.7",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.6",
|
||||
"commit": "af5c98b1cf9b3d180a6326c99ac9c7057eee647f"
|
||||
"tag": "v1.0.7",
|
||||
"commit": "4dfdd8cca76eabe12245e86deb9d5da3cd717460"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-a11y-keys-behavior.git",
|
||||
"_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "polymerelements/iron-a11y-keys-behavior"
|
||||
"_originalSource": "PolymerElements/iron-a11y-keys-behavior"
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-a11y-keys-behavior",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"description": "A behavior that enables keybindings for greater a11y.",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
|
|
|
@ -255,6 +255,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* If true, this property will cause the implementing element to
|
||||
* automatically stop propagation on any handled KeyboardEvents.
|
||||
*/
|
||||
stopKeyboardEventPropagation: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
_boundKeyHandlers: {
|
||||
type: Array,
|
||||
value: function() {
|
||||
|
@ -398,6 +407,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
},
|
||||
|
||||
_onKeyBindingEvent: function(keyBindings, event) {
|
||||
if (this.stopKeyboardEventPropagation) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
keyBindings.forEach(function(keyBinding) {
|
||||
var keyCombo = keyBinding[0];
|
||||
var handlerName = keyBinding[1];
|
||||
|
|
|
@ -30,6 +30,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="NonPropagatingKeys">
|
||||
<template>
|
||||
<x-a11y-basic-keys stop-keyboard-event-propagation></x-a11y-basic-keys>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="ComboKeys">
|
||||
<template>
|
||||
<x-a11y-combo-keys></x-a11y-combo-keys>
|
||||
|
@ -161,6 +167,15 @@ suite('Polymer.IronA11yKeysBehavior', function() {
|
|||
expect(keys.keyCount).to.be.equal(1);
|
||||
});
|
||||
|
||||
test('allows propagation beyond the key combo handler', function() {
|
||||
var keySpy = sinon.spy();
|
||||
document.addEventListener('keydown', keySpy);
|
||||
|
||||
MockInteractions.pressEnter(keys);
|
||||
|
||||
expect(keySpy.callCount).to.be.equal(1);
|
||||
});
|
||||
|
||||
suite('edge cases', function() {
|
||||
test('knows that `spacebar` is the same as `space`', function() {
|
||||
var event = new CustomEvent('keydown');
|
||||
|
@ -242,6 +257,22 @@ suite('Polymer.IronA11yKeysBehavior', function() {
|
|||
});
|
||||
});
|
||||
|
||||
suite('stopping propagation automatically', function() {
|
||||
setup(function() {
|
||||
keys = fixture('NonPropagatingKeys');
|
||||
});
|
||||
|
||||
test('does not propagate key events beyond the combo handler', function() {
|
||||
var keySpy = sinon.spy();
|
||||
|
||||
document.addEventListener('keydown', keySpy);
|
||||
|
||||
MockInteractions.pressEnter(keys);
|
||||
|
||||
expect(keySpy.callCount).to.be.equal(0);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue