Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!-- | 1 <!-- |
| 2 // Copyright 2015 The Chromium Authors. All rights reserved. | 2 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 --> | 5 --> |
| 6 <import src="sky-element.sky" /> | 6 <import src="sky-element.sky" /> |
| 7 <import src="sky-icon.sky" /> | 7 <import src="sky-icon.sky" /> |
| 8 | 8 |
| 9 <sky-element attributes="icon:string"> | 9 <sky-element attributes="icon:string"> |
| 10 <template> | 10 <template> |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 </template> | 32 </template> |
| 33 <script> | 33 <script> |
| 34 import "dart:sky"; | 34 import "dart:sky"; |
| 35 | 35 |
| 36 @Tagname('sky-menu-item') | 36 @Tagname('sky-menu-item') |
| 37 class SkyMenuItem extends SkyElement { | 37 class SkyMenuItem extends SkyElement { |
| 38 SkyIcon _icon; | 38 SkyIcon _icon; |
| 39 Element _label; | 39 Element _label; |
| 40 | 40 |
| 41 void shadowRootReady() { | 41 void shadowRootReady() { |
| 42 super.shadowRootReady(); | |
|
eseidel
2015/02/24 23:39:12
This will still work, correct?
| |
| 43 | |
| 42 _icon = shadowRoot.querySelector('sky-icon'); | 44 _icon = shadowRoot.querySelector('sky-icon'); |
| 43 _icon.type = "${icon}_grey600"; | 45 _icon.type = "${icon}_grey600"; |
| 44 } | 46 } |
| 45 | 47 |
| 46 void iconChanged(String oldValue, String newValue) { | 48 void iconChanged(String oldValue, String newValue) { |
| 47 if (_icon != null) | 49 if (_icon != null) |
| 48 _icon.type = "${newValue}_grey600"; | 50 _icon.type = "${newValue}_grey600"; |
| 49 } | 51 } |
| 50 } | 52 } |
| 51 | 53 |
| 52 _init(script) => register(script, SkyMenuItem); | 54 _init(script) => register(script, SkyMenuItem); |
| 53 </script> | 55 </script> |
| 54 </sky-element> | 56 </sky-element> |
| OLD | NEW |