OLD | NEW |
(Empty) | |
| 1 <!-- |
| 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 |
| 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 |
| 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 |
| 8 --> |
| 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 |
| 58 <link rel="import" href="../polymer/polymer.html"> |
| 59 <link rel="import" href="iron-multi-selectable.html"> |
| 60 |
| 61 <script> |
| 62 |
| 63 Polymer({ |
| 64 |
| 65 is: 'iron-selector', |
| 66 |
| 67 behaviors: [ |
| 68 Polymer.IronMultiSelectableBehavior |
| 69 ] |
| 70 |
| 71 }); |
| 72 |
| 73 </script> |
OLD | NEW |