OLD | NEW |
| (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 <polymer-element name="cr-butterbar" attributes="message action"> | |
6 <template> | |
7 <style> | |
8 span { | |
9 background-color: #F9EDBE; | |
10 border: 1px solid #F0C36D; | |
11 box-shadow: 0 2px 4px rgba(0,0,0,0.2); | |
12 border-radius: 2px; | |
13 padding: 0.25em 16px; | |
14 display: block; | |
15 position: fixed; | |
16 margin: 0 auto; | |
17 right: 0; | |
18 left: 0; | |
19 top: 0.5em; | |
20 max-width: -webkit-min-content; | |
21 white-space: nowrap; | |
22 z-index: 1; | |
23 } | |
24 | |
25 :host-context(dialog) span { | |
26 position: absolute; | |
27 } | |
28 </style> | |
29 <template if="{{ message }}"> | |
30 <span> | |
31 {{ message }} | |
32 <template if="{{ action }}"> | |
33 <a is="cr-action" on-tap="{{ activate }}">{{ action }}</a> | |
34 </template> | |
35 </span> | |
36 </template> | |
37 </template> | |
38 <script> | |
39 Polymer("cr-butterbar", { | |
40 created: function() { | |
41 this.message = ""; | |
42 this.action = ""; | |
43 }, | |
44 activate: function() { | |
45 this.fire("action-activate"); | |
46 }, | |
47 }); | |
48 </script> | |
49 </polymer-element> | |
OLD | NEW |