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
8119b930e4
commit
cbb6337b41
74 changed files with 2195 additions and 1393 deletions
|
@ -10,27 +10,41 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
<link rel="import" href="../iron-behaviors/iron-button-state.html">
|
||||
<link rel="import" href="paper-ripple-behavior.html">
|
||||
|
||||
<script>
|
||||
|
||||
/** @polymerBehavior */
|
||||
/** @polymerBehavior Polymer.PaperButtonBehavior */
|
||||
Polymer.PaperButtonBehaviorImpl = {
|
||||
|
||||
properties: {
|
||||
|
||||
_elevation: {
|
||||
type: Number
|
||||
/**
|
||||
* The z-depth of this element, from 0-5. Setting to 0 will remove the
|
||||
* shadow, and each increasing number greater than 0 will be "deeper"
|
||||
* than the last.
|
||||
*
|
||||
* @attribute elevation
|
||||
* @type number
|
||||
* @default 1
|
||||
*/
|
||||
elevation: {
|
||||
type: Number,
|
||||
reflectToAttribute: true,
|
||||
readOnly: true
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
observers: [
|
||||
'_calculateElevation(focused, disabled, active, pressed, receivedFocusFromKeyboard)'
|
||||
'_calculateElevation(focused, disabled, active, pressed, receivedFocusFromKeyboard)',
|
||||
'_computeKeyboardClass(receivedFocusFromKeyboard)'
|
||||
],
|
||||
|
||||
hostAttributes: {
|
||||
role: 'button',
|
||||
tabindex: '0'
|
||||
tabindex: '0',
|
||||
animated: true
|
||||
},
|
||||
|
||||
_calculateElevation: function() {
|
||||
|
@ -42,14 +56,42 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
} else if (this.receivedFocusFromKeyboard) {
|
||||
e = 3;
|
||||
}
|
||||
this._elevation = e;
|
||||
this._setElevation(e);
|
||||
},
|
||||
|
||||
_computeKeyboardClass: function(receivedFocusFromKeyboard) {
|
||||
this.classList.toggle('keyboard-focus', receivedFocusFromKeyboard);
|
||||
},
|
||||
|
||||
/**
|
||||
* In addition to `IronButtonState` behavior, when space key goes down,
|
||||
* create a ripple down effect.
|
||||
*/
|
||||
_spaceKeyDownHandler: function(event) {
|
||||
Polymer.IronButtonStateImpl._spaceKeyDownHandler.call(this, event);
|
||||
if (this.hasRipple()) {
|
||||
this._ripple.uiDownAction();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* In addition to `IronButtonState` behavior, when space key goes up,
|
||||
* create a ripple up effect.
|
||||
*/
|
||||
_spaceKeyUpHandler: function(event) {
|
||||
Polymer.IronButtonStateImpl._spaceKeyUpHandler.call(this, event);
|
||||
if (this.hasRipple()) {
|
||||
this._ripple.uiUpAction();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/** @polymerBehavior */
|
||||
Polymer.PaperButtonBehavior = [
|
||||
Polymer.IronButtonState,
|
||||
Polymer.IronControlState,
|
||||
Polymer.PaperRippleBehavior,
|
||||
Polymer.PaperButtonBehaviorImpl
|
||||
];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue