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

Side by Side Diff: appengine/chromium_rietveld/new_static/components/cr-action.html

Issue 1001723003: Create a common directory of widgets and css. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
(Empty)
1 <!-- Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 Use of this source code is governed by a BSD-style license that can be
3 found in the LICENSE file. -->
4
5 <!--
6 This is similar to a button, but appears like a link instead. It's generally
7 for non-destructive actions and should never navigate the page.
8
9 ex. <a is="cr-action" on-tap="{{ doSomething }}"></a>
10
11 Note: This element is very common on typical pages so it's been micro
12 optimized to not contain any whitespace and not use data binding in the
13 template.
14 -->
15 <polymer-element name="cr-action" extends="a" on-keyup="{{ handleKeyup }}" on-cl ick="{{ handleClick }}">
16 <template><style>
17 :host {
18 color: #1155CC;
19 cursor: pointer;
20 display: inline-block;
21 text-decoration: none;
22 -webkit-user-select: none;
23 }
24
25 :host(:hover) {
26 text-decoration: underline;
27 }
28 </style><content></content></template>
29 <script>
30 Polymer("cr-action", {
31 created: function() {
32 this.href = "/#";
33 },
34 handleKeyup: function(event) {
35 // Enter and spacebar keys
36 if (event.keyCode == 13 || event.keyCode == 32) {
37 this.fire("tap");
38 event.preventDefault();
39 }
40 },
41 handleClick: function(event) {
42 event.preventDefault();
43 },
44 });
45 </script>
46 </ploymer-element>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698