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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/pdf/elements/viewer-toolbar/viewer-toolbar.html
diff --git a/chrome/browser/resources/pdf/elements/viewer-toolbar/viewer-toolbar.html b/chrome/browser/resources/pdf/elements/viewer-toolbar/viewer-toolbar.html
new file mode 100644
index 0000000000000000000000000000000000000000..09eeb714042523ac5ff03bbf05321898de8a966e
--- /dev/null
+++ b/chrome/browser/resources/pdf/elements/viewer-toolbar/viewer-toolbar.html
@@ -0,0 +1,40 @@
+<polymer-element name="viewer-toolbar" attributes="fadingIn"
+ on-mouseover="{{fadeIn}}" on-mousemove="{{fadeIn}}"
+ on-mouseout="{{fadeOut}}">
+ <template>
+ <link rel="stylesheet" href="viewer-toolbar.css">
+ <div id="toolbar">
+ <content></content>
+ </div>
+ </template>
+ <script>
+ Polymer('viewer-toolbar', {
+ fadingIn: false,
+ ready: function() {
+ 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
+ },
+ fadeIn: function() {
+ this.fadingIn = true;
+ },
+ fadeOut: function() {
+ this.fadingIn = false;
+ },
+ fadingInChanged: function() {
ganetsky1 2013/12/18 20:05:05 fyi, you can use oldValue, newValue as arguments h
+ if (this.fadingIn) {
+ this.style.setProperty("-webkit-transition",
+ "opacity 0.4s ease-in-out");
+ this.style.opacity = 1;
+ } else {
+ if (window.getComputedStyle(this).getPropertyValue("opacity") == 1) {
+ this.style.setProperty("-webkit-transition",
+ "opacity 0.4s ease-in-out 3s");
+ this.style.opacity = 0;
+ } else {
+ // Let the toolbar finish fading in before fading out.
+ 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
+ }
+ }
+ }
+ });
+ </script>
+</polymer-element>

Powered by Google App Engine
This is Rietveld 408576698