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

update components

This commit is contained in:
Luke Pulverenti 2015-08-10 20:14:15 -04:00
parent fa050a3b08
commit f6b3dd3b16
10 changed files with 103 additions and 28 deletions

View file

@ -50,8 +50,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
type: Boolean,
value: false,
notify: true,
reflectToAttribute: true,
observer: '_activeChanged'
reflectToAttribute: true
},
/**
@ -72,6 +71,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
receivedFocusFromKeyboard: {
type: Boolean,
readOnly: true
},
/**
* The aria attribute to be set if the button is a toggle and in the
* active state.
*/
ariaActiveAttribute: {
type: String,
value: 'aria-pressed',
observer: '_ariaActiveAttributeChanged'
}
},
@ -82,7 +91,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
observers: [
'_detectKeyboardFocus(focused)'
'_detectKeyboardFocus(focused)',
'_activeChanged(active, ariaActiveAttribute)'
],
keyBindings: {
@ -180,11 +190,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
this._changedButtonState();
},
_activeChanged: function(active) {
_ariaActiveAttributeChanged: function(value, oldValue) {
if (oldValue && oldValue != value && this.hasAttribute(oldValue)) {
this.removeAttribute(oldValue);
}
},
_activeChanged: function(active, ariaActiveAttribute) {
if (this.toggles) {
this.setAttribute('aria-pressed', active ? 'true' : 'false');
this.setAttribute(this.ariaActiveAttribute,
active ? 'true' : 'false');
} else {
this.removeAttribute('aria-pressed');
this.removeAttribute(this.ariaActiveAttribute);
}
this._changedButtonState();
},