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

update live tv page

This commit is contained in:
Luke Pulverenti 2015-08-20 17:58:07 -04:00
parent 2a0c84a99d
commit 7e0be1ddca
8 changed files with 100 additions and 56 deletions

View file

@ -1,6 +1,6 @@
{
"name": "paper-checkbox",
"version": "1.0.6",
"version": "1.0.7",
"description": "A material design checkbox",
"authors": [
"The Polymer Authors"
@ -34,11 +34,11 @@
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
"polymer": "Polymer/polymer#^1.0.0"
},
"_release": "1.0.6",
"_release": "1.0.7",
"_resolution": {
"type": "version",
"tag": "v1.0.6",
"commit": "764d2f12406ac85aa5e66f280163cb3795c16e20"
"tag": "v1.0.7",
"commit": "129dc6c91e82978b38790061971cbae04f71fc9c"
},
"_source": "git://github.com/PolymerElements/paper-checkbox.git",
"_target": "~1.0.5",

View file

@ -1,6 +1,6 @@
{
"name": "paper-checkbox",
"version": "1.0.6",
"version": "1.0.7",
"description": "A material design checkbox",
"authors": [
"The Polymer Authors"

View file

@ -110,15 +110,25 @@ Custom property | Description | Default
},
attached: function() {
var trimmedText = Polymer.dom(this).textContent.trim();
if (trimmedText === '') {
this.$.checkboxLabel.hidden = true;
}
// Don't stomp over a user-set aria-label.
if (trimmedText !== '' && !this.getAttribute('aria-label')) {
this.setAttribute('aria-label', trimmedText);
}
this._isReady = true;
// Don't stomp over a user-set aria-label.
if (!this.getAttribute('aria-label')) {
this.updateAriaLabel();
}
},
/**
* Update the checkbox aria-label. This is a temporary workaround not
* being able to observe changes in <content>
* (see: https://github.com/Polymer/polymer/issues/1773)
*
* Call this if you manually change the contents of the checkbox
* and want the aria-label to match the new contents.
*/
updateAriaLabel: function() {
this.setAttribute('aria-label', Polymer.dom(this).textContent.trim());
},
// button-behavior hook

View file

@ -76,6 +76,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
MockInteractions.tap(c1);
});
test('checkbox label can be updated', function() {
Polymer.dom(c1).textContent = 'Batman';
c1.updateAriaLabel();
assert.isTrue(c1.getAttribute('aria-label') == 'Batman');
Polymer.dom(c1).textContent = 'Robin';
c1.updateAriaLabel();
assert.isTrue(c1.getAttribute('aria-label') == 'Robin');
});
});
suite('a11y', function() {