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

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..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>

Powered by Google App Engine
This is Rietveld 408576698