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

Side by Side Diff: chrome/browser/resources/pdf/elements/viewer-toolbar/viewer-toolbar.html

Issue 110723007: Add the viewer toolbar to the PDF extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <polymer-element name="viewer-toolbar" attributes="fadingIn"
2 on-mouseover="{{fadeIn}}" on-mousemove="{{fadeIn}}"
3 on-mouseout="{{fadeOut}}">
4 <template>
5 <link rel="stylesheet" href="viewer-toolbar.css">
6 <div id="toolbar">
7 <content></content>
8 </div>
9 </template>
10 <script>
11 Polymer('viewer-toolbar', {
12 fadingIn: false,
13 ready: function() {
14 this.fadingInChanged();
ganetsky1 2013/12/18 20:05:05 Not sure this is necessary, considering you set fa
raymes 2013/12/18 23:28:54 When I tested this, it is needed. It seems like it
15 },
16 fadeIn: function() {
17 this.fadingIn = true;
18 },
19 fadeOut: function() {
20 this.fadingIn = false;
21 },
22 fadingInChanged: function() {
ganetsky1 2013/12/18 20:05:05 fyi, you can use oldValue, newValue as arguments h
23 if (this.fadingIn) {
24 this.style.setProperty("-webkit-transition",
25 "opacity 0.4s ease-in-out");
26 this.style.opacity = 1;
27 } else {
28 if (window.getComputedStyle(this).getPropertyValue("opacity") == 1) {
29 this.style.setProperty("-webkit-transition",
30 "opacity 0.4s ease-in-out 3s");
31 this.style.opacity = 0;
32 } else {
33 // Let the toolbar finish fading in before fading out.
34 setTimeout(this.fadingInChanged.bind(this), 400);
ganetsky1 2013/12/18 20:05:05 Do you really want to call the change watcher agai
raymes 2013/12/18 23:28:54 Yep I want to call the change watcher again. Basic
ganetsky1 2013/12/19 21:52:50 I think your timing is off. I think what you want
raymes 2013/12/20 01:47:30 Hmm, not sure how the timing is off? This code sa
35 }
36 }
37 }
38 });
39 </script>
40 </polymer-element>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698