OLD | NEW |
1 <import src="../../framework/sky-element/sky-element.sky" as="SkyElement" /> | 1 <import src="../../framework/sky-element/sky-element.sky" as="SkyElement" /> |
2 | 2 |
3 <sky-element name="app-search-input"> | 3 <sky-element name="app-search-input"> |
4 <template> | 4 <template> |
5 <style> | 5 <style> |
6 :host { | 6 :host { |
7 background-color: #F6F6F6; | 7 background-color: #F6F6F6; |
8 padding: 4px; | 8 padding: 4px; |
9 display: flex; | 9 display: flex; |
10 align-items: center; | 10 align-items: center; |
11 font-size: 1.2em; | 11 font-size: 1.2em; |
12 } | 12 } |
13 | 13 |
14 .input-text { | 14 .input-text { |
15 margin-left: 8px; | 15 margin-left: 8px; |
16 } | 16 } |
17 </style> | 17 </style> |
18 <span class="input-icon"> | 18 <span class="input-icon"> |
19 <img src="/sky/examples/flights/images/magnifying-glass.png" style="width: 1
6px"> | 19 <img src="/sky/examples/flights/images/magnifying-glass.png" style="width: 1
6px"> |
20 </span> | 20 </span> |
21 <span class="input-text"><t>flights today to dc by price</t></span> | 21 <span class="input-text"><t>flights today to dc by price</t></span> |
22 </template> | 22 </template> |
23 <script> | 23 <script> |
24 module.exports = class extends SkyElement { | 24 module.exports = class extends SkyElement { |
| 25 attached() { |
| 26 var sel = window.getSelection(); |
| 27 var input = this.shadowRoot.querySelector('t'); |
| 28 sel.selectAllChildren(input); |
| 29 } |
25 }.register(); | 30 }.register(); |
26 </script> | 31 </script> |
27 </sky-element> | 32 </sky-element> |
OLD | NEW |