Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(423)

Side by Side Diff: sky/framework/sky-button/sky-button.sky

Issue 874303003: Move sky-box,-button,-checkbox,-radio out of their directories (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/framework/sky-button.sky ('k') | sky/framework/sky-checkbox.sky » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!--
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
4 // found in the LICENSE file.
5 -->
6 <import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" />
7
8 <sky-element
9 name="sky-button"
10 attributes="highlight:boolean"
11 on-pointerdown="handlePointerDown"
12 on-pointerup="handlePointerUp"
13 on-pointercancel="handlePointerCancel">
14 <template>
15 <style>
16 :host {
17 display: inline-flex;
18 border-radius: 4px;
19 justify-content: center;
20 align-items: center;
21 border: 1px solid blue;
22 -webkit-user-select: none;
23 margin: 5px;
24 }
25 :host([highlight=true]) {
26 background-color: orange;
27 }
28 </style>
29 <content />
30 </template>
31 <script>
32 module.exports = class extends SkyElement {
33 created() {
34 super.created();
35
36 this.tabIndex = 0; // Make focusable.
37 }
38 handlePointerDown() {
39 this.highlight = true;
40 }
41 handlePointerUp() {
42 this.highlight = false;
43 }
44 handlePointerCancel() {
45 this.highlight = false;
46 }
47 }.register();
48 </script>
49 </sky-element>
OLDNEW
« no previous file with comments | « sky/framework/sky-button.sky ('k') | sky/framework/sky-checkbox.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698