1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

merge from dev

This commit is contained in:
Luke Pulverenti 2015-12-14 10:43:03 -05:00
parent 1c8f02ce0f
commit 33b01d778c
911 changed files with 34157 additions and 57125 deletions

View file

@ -7,11 +7,12 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
<link rel="import" href="../iron-behaviors/iron-control-state.html">
<script>
/**
* Use `Polymer.PaperInputBehavior` to implement inputs with `<paper-input-container>`. This
* behavior is implemented by `<paper-input>`. It exposes a number of properties from
@ -23,7 +24,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
* @polymerBehavior Polymer.PaperInputBehavior
*/
Polymer.PaperInputBehaviorImpl = {
properties: {
/**
* Fired when the input changes due to user interaction.
@ -32,7 +32,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
*/
/**
* The label for this input. Bind this to `<paper-input-container>`'s `label` property.
* The label for this input. Bind this to `<label>`'s content and `hidden` property, e.g.
* `<label hidden$="[[!label]]">[[label]]</label>` in your `template`
*/
label: {
type: String
@ -91,7 +92,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
/**
* The datalist of the input (if any). This should match the id of an existing <datalist>. Bind this
* The datalist of the input (if any). This should match the id of an existing `<datalist>`. Bind this
* to the `<input is="iron-input">`'s `list` property.
*/
list: {
@ -287,27 +288,55 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
/**
* Bind this to the `<input is="iron-input">`'s `results` property, , used with type=search.
* Bind this to the `<input is="iron-input">`'s `results` property, used with type=search.
*/
results: {
type: Number
},
/**
* Bind this to the `<input is="iron-input">`'s `accept` property, used with type=file.
*/
accept: {
type: String
},
/**
* Bind this to the `<input is="iron-input">`'s `multiple` property, used with type=file.
*/
multiple: {
type: Boolean
},
_ariaDescribedBy: {
type: String,
value: ''
},
_ariaLabelledBy: {
type: String,
value: ''
}
},
listeners: {
'addon-attached': '_onAddonAttached'
'addon-attached': '_onAddonAttached',
'focus': '_onFocus'
},
observers: [
'_focusedControlStateChanged(focused)'
],
keyBindings: {
'shift+tab:keydown': '_onShiftTabDown'
},
hostAttributes: {
tabindex: 0
},
/**
* Returns a reference to the input element.
*/
@ -315,6 +344,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
return this.$.input;
},
/**
* Returns a reference to the focusable element.
*/
get _focusableElement() {
return this.inputElement;
},
attached: function() {
this._updateAriaLabelledBy();
},
@ -348,6 +384,30 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
return this.inputElement.validate();
},
/**
* Forward focus to inputElement
*/
_onFocus: function() {
if (!this._shiftTabPressed) {
this._focusableElement.focus();
}
},
/**
* Handler that is called when a shift+tab keypress is detected by the menu.
*
* @param {CustomEvent} event A key combination event.
*/
_onShiftTabDown: function(event) {
var oldTabIndex = this.getAttribute('tabindex');
this._shiftTabPressed = true;
this.setAttribute('tabindex', '-1');
this.async(function() {
this.setAttribute('tabindex', oldTabIndex);
this._shiftTabPressed = false;
}, 1);
},
/**
* If `autoValidate` is true, then validates the element.
*/
@ -428,10 +488,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
}
}
};
/** @polymerBehavior */
Polymer.PaperInputBehavior = [Polymer.IronControlState, Polymer.PaperInputBehaviorImpl];
Polymer.PaperInputBehavior = [
Polymer.IronControlState,
Polymer.IronA11yKeysBehavior,
Polymer.PaperInputBehaviorImpl
];
</script>