OLD | NEW |
---|---|
(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 <link href="../bower_components/polymer/polymer.html" rel="import"> | |
7 <link href="../bower_components/core-icon/core-icon.html" rel="import"> | |
8 | |
9 <polymer-element name="ct-popup-menu" attributes="{{ icon }}"> | |
10 <template> | |
11 <style> | |
12 :host { | |
13 display: inline-block; | |
14 overflow: hidden; | |
ojan
2014/08/05 02:07:23
Why overflow:hidden?
| |
15 } | |
16 #menu { | |
17 position: absolute; | |
18 overflow-y: scroll; | |
ojan
2014/08/05 02:07:23
s/scroll/auto?
leviw_travelin_and_unemployed
2014/08/05 20:51:17
With scroll, we don't wrap the contents. With auto
ojan
2014/08/06 22:58:46
Def sounds like a blink bug. At least add a FIXME?
| |
19 transition: transform 0.2s ease-in-out, opacity 0.2s ease-in; | |
20 border: 1px solid grey; | |
21 -webkit-box-shadow: 3px 4px 20px 0px rgba(0,0,0,0.75); | |
22 max-height: 300px; | |
23 padding: 1em; | |
24 z-index: 50; | |
25 background-color: white; | |
26 } | |
27 #scrim { | |
28 position: fixed; | |
29 top: 0; | |
30 bottom: 0; | |
31 left: 0; | |
32 right: 0; | |
33 z-index: 49; | |
34 } | |
35 core-icon { | |
36 position: relative; | |
37 top: 0.5em; | |
ojan
2014/08/05 02:07:23
Is this trying to center it? The better way to cen
| |
38 } | |
39 .hidden { | |
40 visibility: hidden; | |
ojan
2014/08/05 02:07:23
Don't think you need this if you have the opacity:
leviw_travelin_and_unemployed
2014/08/05 20:51:17
It will still hit test otherwise and get in the wa
ojan
2014/08/06 22:58:46
Ah. Mind adding an explanatory comment?
| |
41 opacity: 0; | |
42 } | |
43 </style> | |
44 <core-icon src="{{src}}" icon="{{icon}}" on-click="{{ showAction }}"></core- icon> | |
ojan
2014/08/05 02:07:23
Need spaces around src/icon
| |
45 <div id="menu" class="hidden"> | |
46 <content></content> | |
47 </div> | |
48 <div id="scrim" class="hidden" on-click="{{ hideAction }}"></div> | |
ojan
2014/08/05 02:07:23
This is just to capture clicks? If so, you should
| |
49 </template> | |
50 <script> | |
51 (function() { | |
52 Polymer({ | |
53 showAction: function() { | |
ojan
2014/08/05 02:07:23
Nit: _showAction and _hideAction
| |
54 this.$.menu.classList.remove('hidden'); | |
55 this.$.scrim.classList.remove('hidden'); | |
56 }, | |
57 | |
58 hideAction: function() { | |
59 this.$.menu.classList.add('hidden'); | |
60 this.$.scrim.classList.add('hidden'); | |
61 }, | |
62 }); | |
63 })(); | |
64 </script> | |
65 </polymer-element> | |
OLD | NEW |