mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
fa050a3b08
commit
f6b3dd3b16
10 changed files with 103 additions and 28 deletions
|
@ -6850,8 +6850,7 @@ this.fire('dom-change');
|
|||
type: Boolean,
|
||||
value: false,
|
||||
notify: true,
|
||||
reflectToAttribute: true,
|
||||
observer: '_activeChanged'
|
||||
reflectToAttribute: true
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -6872,6 +6871,16 @@ this.fire('dom-change');
|
|||
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'
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -6882,7 +6891,8 @@ this.fire('dom-change');
|
|||
},
|
||||
|
||||
observers: [
|
||||
'_detectKeyboardFocus(focused)'
|
||||
'_detectKeyboardFocus(focused)',
|
||||
'_activeChanged(active, ariaActiveAttribute)'
|
||||
],
|
||||
|
||||
keyBindings: {
|
||||
|
@ -6980,11 +6990,18 @@ this.fire('dom-change');
|
|||
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();
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue