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

Unified Diff: elements/viewer-page-indicator/viewer-page-indicator.html

Issue 169163004: Allow click events to pass through the toolbar padding. (Closed) Base URL: https://chromium.googlesource.com/chromium/html-office-public.git@master
Patch Set: Created 6 years, 10 months 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
« no previous file with comments | « elements/viewer-button/viewer-button.css ('k') | elements/viewer-toolbar/viewer-toolbar.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: elements/viewer-page-indicator/viewer-page-indicator.html
diff --git a/elements/viewer-page-indicator/viewer-page-indicator.html b/elements/viewer-page-indicator/viewer-page-indicator.html
index 80fb4045ed67f9da75abae4d3b372cda0ac94f87..fb247a2f0890f283f13db6c168653c40559c9427 100644
--- a/elements/viewer-page-indicator/viewer-page-indicator.html
+++ b/elements/viewer-page-indicator/viewer-page-indicator.html
@@ -9,26 +9,28 @@
text: '1',
timerId: undefined,
ready: function() {
- var scrollCallback = function() {
- var percent = window.scrollY /
- (document.body.scrollHeight -
- document.documentElement.clientHeight);
- this.style.top = percent *
- (document.documentElement.clientHeight - this.offsetHeight) + 'px';
- this.style.opacity = 1;
- clearTimeout(this.timerId);
-
- this.timerId = setTimeout(function() {
- this.style.opacity = 0;
- this.timerId = undefined;
- }.bind(this), 2000);
- }.bind(this);
+ var callback = this.fadeIn.bind(this, 2000);
window.addEventListener('scroll', function() {
- requestAnimationFrame(scrollCallback);
+ requestAnimationFrame(callback);
});
-
- scrollCallback();
},
+ initialFadeIn: function() {
+ this.fadeIn(6000);
+ },
+ fadeIn: function(displayTime) {
+ var percent = window.scrollY /
+ (document.body.scrollHeight -
+ document.documentElement.clientHeight);
+ this.style.top = percent *
+ (document.documentElement.clientHeight - this.offsetHeight) + 'px';
+ this.style.opacity = 1;
+ clearTimeout(this.timerId);
+
+ this.timerId = setTimeout(function() {
+ this.style.opacity = 0;
+ this.timerId = undefined;
+ }.bind(this), displayTime);
+ }
});
</script>
</polymer-element>
« no previous file with comments | « elements/viewer-button/viewer-button.css ('k') | elements/viewer-toolbar/viewer-toolbar.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698