OLD | NEW |
1 <!-- | 1 <!-- |
2 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 2 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 | 3 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 | 4 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 | 5 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 | 6 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 | 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
8 --> | 8 --> |
9 | 9 |
10 <!-- | |
11 `iron-selector` is an element which can be used to manage a list of elements | |
12 that can be selected. Tapping on the item will make the item selected. The `se
lected` indicates | |
13 which item is being selected. The default is to use the index of the item. | |
14 | |
15 Example: | |
16 | |
17 <iron-selector selected="0"> | |
18 <div>Item 1</div> | |
19 <div>Item 2</div> | |
20 <div>Item 3</div> | |
21 </iron-selector> | |
22 | |
23 If you want to use the attribute value of an element for `selected` instead of t
he index, | |
24 set `attrForSelected` to the name of the attribute. For example, if you want to
select item by | |
25 `name`, set `attrForSelected` to `name`. | |
26 | |
27 Example: | |
28 | |
29 <iron-selector attr-for-selected="name" selected="foo"> | |
30 <div name="foo">Foo</div> | |
31 <div name="bar">Bar</div> | |
32 <div name="zot">Zot</div> | |
33 </iron-selector> | |
34 | |
35 `iron-selector` is not styled. Use the `iron-selected` CSS class to style the se
lected element. | |
36 | |
37 Example: | |
38 | |
39 <style> | |
40 .iron-selected { | |
41 background: #eee; | |
42 } | |
43 </style> | |
44 | |
45 ... | |
46 | |
47 <iron-selector selected="0"> | |
48 <div>Item 1</div> | |
49 <div>Item 2</div> | |
50 <div>Item 3</div> | |
51 </iron-selector> | |
52 | |
53 @group Polymer Core Elements | |
54 @element iron-selector | |
55 @homepage github.io | |
56 --> | |
57 | 10 |
58 <link rel="import" href="../polymer/polymer.html"> | 11 <link rel="import" href="../polymer/polymer.html"> |
59 <link rel="import" href="iron-multi-selectable.html"> | 12 <link rel="import" href="iron-multi-selectable.html"> |
60 | 13 |
61 <script> | 14 <script> |
| 15 /** |
| 16 `iron-selector` is an element which can be used to manage a list of elements |
| 17 that can be selected. Tapping on the item will make the item selected. The `
selected` indicates |
| 18 which item is being selected. The default is to use the index of the item. |
| 19 |
| 20 Example: |
| 21 |
| 22 <iron-selector selected="0"> |
| 23 <div>Item 1</div> |
| 24 <div>Item 2</div> |
| 25 <div>Item 3</div> |
| 26 </iron-selector> |
| 27 |
| 28 If you want to use the attribute value of an element for `selected` instead of
the index, |
| 29 set `attrForSelected` to the name of the attribute. For example, if you want
to select item by |
| 30 `name`, set `attrForSelected` to `name`. |
| 31 |
| 32 Example: |
| 33 |
| 34 <iron-selector attr-for-selected="name" selected="foo"> |
| 35 <div name="foo">Foo</div> |
| 36 <div name="bar">Bar</div> |
| 37 <div name="zot">Zot</div> |
| 38 </iron-selector> |
| 39 |
| 40 `iron-selector` is not styled. Use the `iron-selected` CSS class to style the
selected element. |
| 41 |
| 42 Example: |
| 43 |
| 44 <style> |
| 45 .iron-selected { |
| 46 background: #eee; |
| 47 } |
| 48 </style> |
| 49 |
| 50 ... |
| 51 |
| 52 <iron-selector selected="0"> |
| 53 <div>Item 1</div> |
| 54 <div>Item 2</div> |
| 55 <div>Item 3</div> |
| 56 </iron-selector> |
| 57 |
| 58 @demo demo/index.html |
| 59 */ |
62 | 60 |
63 Polymer({ | 61 Polymer({ |
64 | 62 |
65 is: 'iron-selector', | 63 is: 'iron-selector', |
66 | 64 |
67 behaviors: [ | 65 behaviors: [ |
68 Polymer.IronMultiSelectableBehavior | 66 Polymer.IronMultiSelectableBehavior |
69 ] | 67 ] |
70 | 68 |
71 }); | 69 }); |
72 | 70 |
73 </script> | 71 </script> |
OLD | NEW |