mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add new slider
This commit is contained in:
parent
e33e5875cf
commit
09d4af3357
133 changed files with 9418 additions and 256 deletions
101
dashboard-ui/bower_components/iron-validatable-behavior/iron-validatable-behavior.html
vendored
Normal file
101
dashboard-ui/bower_components/iron-validatable-behavior/iron-validatable-behavior.html
vendored
Normal file
|
@ -0,0 +1,101 @@
|
|||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
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-meta/iron-meta.html">
|
||||
|
||||
<script>
|
||||
|
||||
/**
|
||||
* Use `Polymer.IronValidatableBehavior` to implement an element that validates user input.
|
||||
*
|
||||
* ### Accessiblity
|
||||
*
|
||||
* Changing the `invalid` property, either manually or by calling `validate()` will update the
|
||||
* `aria-invalid` attribute.
|
||||
*
|
||||
* @demo demo/index.html
|
||||
* @polymerBehavior
|
||||
*/
|
||||
Polymer.IronValidatableBehavior = {
|
||||
|
||||
properties: {
|
||||
|
||||
/**
|
||||
* Namespace for this validator.
|
||||
*/
|
||||
validatorType: {
|
||||
type: String,
|
||||
value: 'validator'
|
||||
},
|
||||
|
||||
/**
|
||||
* Name of the validator to use.
|
||||
*/
|
||||
validator: {
|
||||
type: String
|
||||
},
|
||||
|
||||
/**
|
||||
* True if the last call to `validate` is invalid.
|
||||
*/
|
||||
invalid: {
|
||||
notify: true,
|
||||
reflectToAttribute: true,
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
_validatorMeta: {
|
||||
type: Object
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
observers: [
|
||||
'_invalidChanged(invalid)'
|
||||
],
|
||||
|
||||
get _validator() {
|
||||
return this._validatorMeta && this._validatorMeta.byKey(this.validator);
|
||||
},
|
||||
|
||||
ready: function() {
|
||||
this._validatorMeta = new Polymer.IronMeta({type: this.validatorType});
|
||||
},
|
||||
|
||||
_invalidChanged: function() {
|
||||
if (this.invalid) {
|
||||
this.setAttribute('aria-invalid', 'true');
|
||||
} else {
|
||||
this.removeAttribute('aria-invalid');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @return {boolean} True if the validator `validator` exists.
|
||||
*/
|
||||
hasValidator: function() {
|
||||
return this._validator != null;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Object} values Passed to the validator's `validate()` function.
|
||||
* @return {boolean} True if `values` is valid.
|
||||
*/
|
||||
validate: function(values) {
|
||||
var valid = this._validator && this._validator.validate(values);
|
||||
this.invalid = !valid;
|
||||
return valid;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue