| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 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/framework/sky-button/sky-button.sky" as="SkyButton" /> | 6 <import src="/sky/framework/sky-button/sky-button.sky" as="SkyButton" /> |
| 7 | 7 |
| 8 <sky-element | 8 <sky-element |
| 9 name="sky-checkbox" | 9 name="sky-checkbox" |
| 10 attributes="checked:boolean" | 10 attributes="checked:boolean" |
| 11 on-mouseup="handleMouseUp"> | 11 on-click="handleClick"> |
| 12 <template> | 12 <template> |
| 13 <style> | 13 <style> |
| 14 :host { | 14 :host { |
| 15 display: flex; | 15 display: flex; |
| 16 justify-content: center; | 16 justify-content: center; |
| 17 align-items: center; | 17 align-items: center; |
| 18 -webkit-user-select: none; | 18 -webkit-user-select: none; |
| 19 cursor: pointer; | 19 cursor: pointer; |
| 20 width: 30px; | 20 width: 30px; |
| 21 height: 30px; | 21 height: 30px; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 this.containerStyle = ''; | 59 this.containerStyle = ''; |
| 60 this.checkStyle = ''; | 60 this.checkStyle = ''; |
| 61 } | 61 } |
| 62 checkedChanged(oldValue, newValue) { | 62 checkedChanged(oldValue, newValue) { |
| 63 this.checkStyle = newValue ? 'checked' : ''; | 63 this.checkStyle = newValue ? 'checked' : ''; |
| 64 } | 64 } |
| 65 highlightChanged(oldValue, newValue) { | 65 highlightChanged(oldValue, newValue) { |
| 66 this.containerStyle = newValue ? 'highlight' : ''; | 66 this.containerStyle = newValue ? 'highlight' : ''; |
| 67 } | 67 } |
| 68 handleMouseUp() { | 68 handleClick() { |
| 69 this.checked = !this.checked; | 69 this.checked = !this.checked; |
| 70 } | 70 } |
| 71 }.register(); | 71 }.register(); |
| 72 </script> | 72 </script> |
| 73 </sky-element> | 73 </sky-element> |
| OLD | NEW |