update components

This commit is contained in:
Luke Pulverenti 2015-08-07 10:21:29 -04:00
parent ffb0fd30b6
commit d131f21626
27 changed files with 180 additions and 115 deletions

View file

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

View file

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

View file

@ -1,4 +1,5 @@
/*
/**
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt

View file

@ -109,11 +109,14 @@ Custom property | Description | Default
}
},
ready: function() {
if (Polymer.dom(this).textContent == '') {
attached: function() {
var trimmedText = Polymer.dom(this).textContent.trim();
if (trimmedText === '') {
this.$.checkboxLabel.hidden = true;
} else {
this.setAttribute('aria-label', Polymer.dom(this).textContent);
}
// Don't stomp over a user-set aria-label.
if (trimmedText !== '' && !this.getAttribute('aria-label')) {
this.setAttribute('aria-label', trimmedText);
}
this._isReady = true;
},

View file

@ -36,6 +36,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template>
</test-fixture>
<test-fixture id="AriaLabel">
<template>
<paper-checkbox id="check3" aria-label="Batman">Robin</paper-checkbox>
</template>
</test-fixture>
<script>
suite('defaults', function() {
var c1;
@ -93,6 +99,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('checkbox with a label sets an aria label', function() {
assert.isTrue(c2.getAttribute('aria-label') == "Batman");
});
test('checkbox respects the user set aria-label', function() {
var c = fixture('AriaLabel');
assert.isTrue(c.getAttribute('aria-label') == "Batman");
});
});
</script>
</body>