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

Unified Diff: third_party/polymer/v1_0/components-chromium/app-layout/app-scroll-effects/effects/resize-snapped-title-extracted.js

Issue 1984963002: Roll Polymer elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: third_party/polymer/v1_0/components-chromium/app-layout/app-scroll-effects/effects/resize-snapped-title-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/app-layout/app-scroll-effects/effects/resize-snapped-title-extracted.js b/third_party/polymer/v1_0/components-chromium/app-layout/app-scroll-effects/effects/resize-snapped-title-extracted.js
new file mode 100644
index 0000000000000000000000000000000000000000..37f656c9f86269cc037175460818d7139a690a13
--- /dev/null
+++ b/third_party/polymer/v1_0/components-chromium/app-layout/app-scroll-effects/effects/resize-snapped-title-extracted.js
@@ -0,0 +1,51 @@
+/**
+ * Upon scrolling past a threshold, CSS transition the font size of a designated title element
+ * between two values.
+ */
+ Polymer.AppLayout.registerEffect('resize-snapped-title', {
+ /**
+ * @this Polymer.AppLayout.ElementWithBackground
+ */
+ setUp: function setUp(config) {
+ var title = Polymer.dom(this).querySelector('[title]');
+ var condensedTitle = Polymer.dom(this).querySelector('[condensed-title]');
+ var duration = config.duration || '0.2s';
+ var fx = {};
+
+ if (!condensedTitle) {
+ this._warn(this._logf('effects[resize-snapped-title]', 'undefined `condensed-title`'));
+ return false;
+ }
+ if (!title) {
+ this._warn(this._logf('effects[resize-snapped-title]', 'undefined `title`'));
+ return false;
+ }
+
+ title.style.transitionProperty = 'opacity';
+ title.style.transitionDuration = duration;
+ condensedTitle.style.transitionProperty = 'opacity';
+ condensedTitle.style.transitionDuration = duration;
+
+ fx.condensedTitle = condensedTitle;
+ fx.title = title;
+ this._fxResizeSnappedTitle = fx;
+ },
+ /** @this Polymer.AppLayout.ElementWithBackground */
+ tearDown: function tearDown() {
+ var fx = this._fxResizeSnappedTitle;
+ fx.title.style.transition = '';
+ fx.condensedTitle.style.transition = '';
+ delete this._fxResizeSnappedTitle;
+ },
+ /** @this Polymer.AppLayout.ElementWithBackground */
+ run: function run(p, y) {
+ var fx = this._fxResizeSnappedTitle;
+ if (p > 0) {
+ fx.title.style.opacity = 0;
+ fx.condensedTitle.style.opacity = 1;
+ } else {
+ fx.title.style.opacity = 1;
+ fx.condensedTitle.style.opacity = 0;
+ }
+ }
+ });

Powered by Google App Engine
This is Rietveld 408576698