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..61c4c432a1013e3edb2d92e1f36ba175f1b3cbe5 |
--- /dev/null |
+++ b/chrome/browser/resources/pdf/elements/viewer-toolbar/viewer-toolbar.html |
@@ -0,0 +1,41 @@ |
+<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, |
+ timerIsRunning: false, |
+ timerId: 0, |
+ ready: function() { |
+ this.fadingInChanged(); |
+ }, |
+ fadeIn: function() { |
+ this.fadingIn = true; |
+ }, |
+ fadeOut: function() { |
+ this.fadingIn = false; |
+ }, |
+ fadingInChanged: function() { |
+ if (this.fadingIn) { |
+ this.style.opacity = 1; |
+ if (this.timerIsRunning) { |
+ this.timerIsRunning = false; |
+ clearTimeout(this.timerId); |
+ } |
+ } else { |
+ if (!this.timerIsRunning) { |
+ this.timerIsRunning = true; |
+ this.timerId = setTimeout( |
+ function() { this.style.opacity = 0; }.bind(this), 3000); |
+ } |
ganetsky1
2014/01/03 18:14:39
There are numerous things I don't understand here:
raymes
2014/01/06 00:22:45
1) Done, thanks.
2) The transition has been moved
ganetsky1
2014/01/08 06:13:43
Please correct me if I'm wrong somewhere:
There s
|
+ } |
+ } |
+ }); |
+ </script> |
+</polymer-element> |