OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 -- Copyright (c) 2013 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 |
| 7 <element name="kb-key" attributes="toKeyset char repeat" on-pointerdown="down" |
| 8 on-pointerup="up"> |
| 9 <template> |
| 10 <style> |
| 11 @host { |
| 12 * { |
| 13 -webkit-box-flex: 1; |
| 14 display: -webkit-box; |
| 15 position: relative; |
| 16 background-position: center center; |
| 17 background-repeat: no-repeat; |
| 18 background-size: contain; |
| 19 } |
| 20 } |
| 21 .key { |
| 22 bottom: 0; |
| 23 left: 0; |
| 24 height: 1.2em; |
| 25 margin: auto; |
| 26 position: absolute; |
| 27 right: 0; |
| 28 top: 0; |
| 29 text-align: center; |
| 30 } |
| 31 </style> |
| 32 <div id="key" class="key"> |
| 33 <content></content> |
| 34 </div> |
| 35 </template> |
| 36 <script> |
| 37 Polymer.register(this, { |
| 38 repeat: false, |
| 39 down: function(event) { |
| 40 var detail = { |
| 41 char: this.char || this.textContent, |
| 42 toKeyset: this.toKeyset, |
| 43 repeat: this.repeat |
| 44 }; |
| 45 this.send('key-down', detail); |
| 46 }, |
| 47 up: function(event) { |
| 48 var detail = { |
| 49 char: this.char || this.textContent, |
| 50 toKeyset: this.toKeyset |
| 51 }; |
| 52 this.send('key-up', detail); |
| 53 } |
| 54 }); |
| 55 </script> |
| 56 </element> |
OLD | NEW |