OLD | NEW |
1 <!-- | 1 <!-- |
| 2 @license |
2 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
6 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
8 --> | 9 --> |
9 | 10 |
10 <!-- | |
11 /** | |
12 * @group Iron Elements | |
13 * | |
14 * The `iron-iconset` element allows users to define their own icon sets. | |
15 * The `src` property specifies the url of the icon image. Multiple icons may | |
16 * be included in this image and they may be organized into rows. | |
17 * The `icons` property is a space separated list of names corresponding to the | |
18 * icons. The names must be ordered as the icons are ordered in the icon image. | |
19 * Icons are expected to be square and are the size specified by the `size` | |
20 * property. The `width` property corresponds to the width of the icon image | |
21 * and must be specified if icons are arranged into multiple rows in the image. | |
22 * | |
23 * All `iron-iconset` elements are available for use by other `iron-iconset` | |
24 * elements via a database keyed by id. Typically, an element author that wants | |
25 * to support a set of custom icons uses a `iron-iconset` to retrieve | |
26 * and use another, user-defined iconset. | |
27 * | |
28 * Example: | |
29 * | |
30 * <iron-iconset id="my-icons" src="my-icons.png" width="96" size="24" | |
31 * icons="location place starta stopb bus car train walk"> | |
32 * </iron-iconset> | |
33 * | |
34 * This will automatically register the icon set "my-icons" to the iconset | |
35 * database. To use these icons from within another element, make a | |
36 * `iron-iconset` element and call the `byId` method to retrieve a | |
37 * given iconset. To apply a particular icon to an element, use the | |
38 * `applyIcon` method. For example: | |
39 * | |
40 * iconset.applyIcon(iconNode, 'car'); | |
41 * | |
42 * Themed icon sets are also supported. The `iron-iconset` can contain child | |
43 * `property` elements that specify a theme with an offsetX and offsetY of the | |
44 * theme within the icon resource. For example. | |
45 * | |
46 * <iron-iconset id="my-icons" src="my-icons.png" width="96" size="24" | |
47 * icons="location place starta stopb bus car train walk"> | |
48 * <property theme="special" offsetX="256" offsetY="24"></property> | |
49 * </iron-iconset> | |
50 * | |
51 * Then a themed icon can be applied like this: | |
52 * | |
53 * iconset.applyIcon(iconNode, 'car', 'special'); | |
54 * | |
55 * @element iron-iconset | |
56 */ | |
57 --> | |
58 <link rel="import" href="../polymer/polymer.html"> | 11 <link rel="import" href="../polymer/polymer.html"> |
59 <link rel="import" href="../iron-meta/iron-meta.html"> | 12 <link rel="import" href="../iron-meta/iron-meta.html"> |
60 | 13 |
| 14 <!-- |
| 15 The `iron-iconset` element allows users to define their own icon sets. |
| 16 The `src` property specifies the url of the icon image. Multiple icons may |
| 17 be included in this image and they may be organized into rows. |
| 18 The `icons` property is a space separated list of names corresponding to the |
| 19 icons. The names must be ordered as the icons are ordered in the icon image. |
| 20 Icons are expected to be square and are the size specified by the `size` |
| 21 property. The `width` property corresponds to the width of the icon image |
| 22 and must be specified if icons are arranged into multiple rows in the image. |
| 23 |
| 24 All `iron-iconset` elements are available for use by other `iron-iconset` |
| 25 elements via a database keyed by id. Typically, an element author that wants |
| 26 to support a set of custom icons uses a `iron-iconset` to retrieve |
| 27 and use another, user-defined iconset. |
| 28 |
| 29 Example: |
| 30 |
| 31 <iron-iconset id="my-icons" src="my-icons.png" width="96" size="24" |
| 32 icons="location place starta stopb bus car train walk"> |
| 33 </iron-iconset> |
| 34 |
| 35 This will automatically register the icon set "my-icons" to the iconset |
| 36 database. To use these icons from within another element, make a |
| 37 `iron-iconset` element and call the `byId` method to retrieve a |
| 38 given iconset. To apply a particular icon to an element, use the |
| 39 `applyIcon` method. For example: |
| 40 |
| 41 iconset.applyIcon(iconNode, 'car'); |
| 42 |
| 43 Themed icon sets are also supported. The `iron-iconset` can contain child |
| 44 `property` elements that specify a theme with an offsetX and offsetY of the |
| 45 theme within the icon resource. For example. |
| 46 |
| 47 <iron-iconset id="my-icons" src="my-icons.png" width="96" size="24" |
| 48 icons="location place starta stopb bus car train walk"> |
| 49 <property theme="special" offsetX="256" offsetY="24"></property> |
| 50 </iron-iconset> |
| 51 |
| 52 Then a themed icon can be applied like this: |
| 53 |
| 54 iconset.applyIcon(iconNode, 'car', 'special'); |
| 55 |
| 56 @element iron-iconset |
| 57 --> |
| 58 |
61 <script> | 59 <script> |
62 | 60 |
63 Polymer({ | 61 Polymer({ |
64 | 62 |
65 is: 'iron-iconset', | 63 is: 'iron-iconset', |
66 | 64 |
67 properties: { | 65 properties: { |
68 | 66 |
69 /** | 67 /** |
70 * The URL of the iconset image. | 68 * The URL of the iconset image. |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 element.setAttribute('role', 'img'); | 327 element.setAttribute('role', 'img'); |
330 }, | 328 }, |
331 | 329 |
332 _removeIconStyles: function(style) { | 330 _removeIconStyles: function(style) { |
333 style.background = ''; | 331 style.background = ''; |
334 } | 332 } |
335 | 333 |
336 }); | 334 }); |
337 | 335 |
338 </script> | 336 </script> |
OLD | NEW |