flutter_flutter/framework/sky-button.sky
Adam Barth 63b6ffb281 Normalize import paths for Sky modules
This CL simplifies the sky_server to only map the build directory into /gen,
which will make the deploy script simpler. This CL updates all the imports to
use the /gen prefix when referring to generated files.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/881093003
2015-01-27 17:04:40 -08:00

50 lines
1.1 KiB
Plaintext

<!--
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-->
<import src="sky-element/sky-element.sky" as="SkyElement" />
<sky-element
name="sky-button"
attributes="highlight:boolean"
on-pointerdown="handlePointerDown"
on-pointerup="handlePointerUp"
on-pointercancel="handlePointerCancel">
<template>
<style>
:host {
display: inline-flex;
border-radius: 4px;
justify-content: center;
align-items: center;
border: 1px solid blue;
-webkit-user-select: none;
margin: 5px;
}
:host([highlight=true]) {
background-color: orange;
}
</style>
<content />
</template>
<script>
module.exports = class extends SkyElement {
created() {
super.created();
this.tabIndex = 0; // Make focusable.
}
handlePointerDown() {
this.highlight = true;
}
handlePointerUp() {
this.highlight = false;
}
handlePointerCancel() {
this.highlight = false;
}
}.register();
</script>
</sky-element>