Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /** | 1 /** |
| 2 * The `iron-iconset-svg` element allows users to define their own icon sets | 2 * The `iron-iconset-svg` element allows users to define their own icon sets |
| 3 * that contain svg icons. The svg icon elements should be children of the | 3 * that contain svg icons. The svg icon elements should be children of the |
| 4 * `iron-iconset-svg` element. Multiple icons should be given distinct id's. | 4 * `iron-iconset-svg` element. Multiple icons should be given distinct id's. |
| 5 * | 5 * |
| 6 * Using svg elements to create icons has a few advantages over traditional | 6 * Using svg elements to create icons has a few advantages over traditional |
| 7 * bitmap graphics like jpg or png. Icons that use svg are vector based so the y | 7 * bitmap graphics like jpg or png. Icons that use svg are vector based so the y |
| 8 * are resolution independent and should look good on any device. They are | 8 * are resolution independent and should look good on any device. They are |
| 9 * stylable via css. Icons can be themed, colorized, and even animated. | 9 * stylable via css. Icons can be themed, colorized, and even animated. |
| 10 * | 10 * |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 * database. To use these icons from within another element, make a | 25 * database. To use these icons from within another element, make a |
| 26 * `iron-iconset` element and call the `byId` method | 26 * `iron-iconset` element and call the `byId` method |
| 27 * to retrieve a given iconset. To apply a particular icon inside an | 27 * to retrieve a given iconset. To apply a particular icon inside an |
| 28 * element use the `applyIcon` method. For example: | 28 * element use the `applyIcon` method. For example: |
| 29 * | 29 * |
| 30 * iconset.applyIcon(iconNode, 'car'); | 30 * iconset.applyIcon(iconNode, 'car'); |
| 31 * | 31 * |
| 32 * @element iron-iconset-svg | 32 * @element iron-iconset-svg |
| 33 * @demo demo/index.html | 33 * @demo demo/index.html |
| 34 */ | 34 */ |
| 35 Polymer({ | 35 Polymer.IronIconsetSvg = Polymer({ |
|
stevenjb
2015/09/18 22:40:15
I have a pull request to fix this here:
https://gi
michaelpg
2015/09/19 03:04:08
yes, add it to the chromium.patch referenced in sr
michaelpg
2015/09/22 23:57:46
i just discovered this:
@type {IronIconsetSvgElem
stevenjb
2015/09/23 18:46:24
Removed as per discussion.
| |
| 36 | 36 |
| 37 is: 'iron-iconset-svg', | 37 is: 'iron-iconset-svg', |
| 38 | 38 |
| 39 properties: { | 39 properties: { |
| 40 | 40 |
| 41 /** | 41 /** |
| 42 * The name of the iconset. | 42 * The name of the iconset. |
| 43 * | 43 * |
| 44 * @attribute name | 44 * @attribute name |
| 45 * @type string | 45 * @type string |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 svg.setAttribute('preserveAspectRatio', 'xMidYMid meet'); | 167 svg.setAttribute('preserveAspectRatio', 'xMidYMid meet'); |
| 168 // TODO(dfreedm): `pointer-events: none` works around https://crbug.com/ 370136 | 168 // TODO(dfreedm): `pointer-events: none` works around https://crbug.com/ 370136 |
| 169 // TODO(sjmiles): inline style may not be ideal, but avoids requiring a shadow-root | 169 // TODO(sjmiles): inline style may not be ideal, but avoids requiring a shadow-root |
| 170 svg.style.cssText = 'pointer-events: none; display: block; width: 100%; height: 100%;'; | 170 svg.style.cssText = 'pointer-events: none; display: block; width: 100%; height: 100%;'; |
| 171 svg.appendChild(sourceSvg.cloneNode(true)).removeAttribute('id'); | 171 svg.appendChild(sourceSvg.cloneNode(true)).removeAttribute('id'); |
| 172 return svg; | 172 return svg; |
| 173 } | 173 } |
| 174 return null; | 174 return null; |
| 175 } | 175 } |
| 176 | 176 |
| 177 }); | 177 }); |
| OLD | NEW |