update live tv page
This commit is contained in:
parent
2a0c84a99d
commit
7e0be1ddca
8 changed files with 100 additions and 56 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue