| 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 --><!-- | |
| 9 `iron-selector` is an element which can be used to manage a list of elements | |
| 10 that can be selected. Tapping on the item will make the item selected. The `se
lected` indicates | |
| 11 which item is being selected. The default is to use the index of the item. | |
| 12 | |
| 13 Example: | |
| 14 | |
| 15 <iron-selector selected="0"> | |
| 16 <div>Item 1</div> | |
| 17 <div>Item 2</div> | |
| 18 <div>Item 3</div> | |
| 19 </iron-selector> | |
| 20 | |
| 21 If you want to use the attribute value of an element for `selected` instead of t
he index, | |
| 22 set `attrForSelected` to the name of the attribute. For example, if you want to
select item by | |
| 23 `name`, set `attrForSelected` to `name`. | |
| 24 | |
| 25 Example: | |
| 26 | |
| 27 <iron-selector attr-for-selected="name" selected="foo"> | |
| 28 <div name="foo">Foo</div> | |
| 29 <div name="bar">Bar</div> | |
| 30 <div name="zot">Zot</div> | |
| 31 </iron-selector> | |
| 32 | |
| 33 `iron-selector` is not styled. Use the `iron-selected` CSS class to style the se
lected element. | |
| 34 | |
| 35 Example: | |
| 36 | |
| 37 <style> | |
| 38 .iron-selected { | |
| 39 background: #eee; | |
| 40 } | |
| 41 </style> | |
| 42 | |
| 43 ... | |
| 44 | |
| 45 <iron-selector selected="0"> | |
| 46 <div>Item 1</div> | |
| 47 <div>Item 2</div> | |
| 48 <div>Item 3</div> | |
| 49 </iron-selector> | |
| 50 | |
| 51 @group Polymer Core Elements | |
| 52 @element iron-selector | |
| 53 @homepage github.io | |
| 54 --><html><head><link rel="import" href="../polymer/polymer.html"> | 8 --><html><head><link rel="import" href="../polymer/polymer.html"> |
| 55 <link rel="import" href="iron-multi-selectable.html"> | 9 <link rel="import" href="iron-multi-selectable.html"> |
| 56 | 10 |
| 57 </head><body><script src="iron-selector-extracted.js"></script></body></html> | 11 </head><body><script src="iron-selector-extracted.js"></script></body></html> |
| OLD | NEW |