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

Unified Diff: third_party/polymer/v1_0/components-chromium/neon-animation/neon-animated-pages-extracted.js

Issue 1221923003: Update bower.json for Polymer elements and add PRESUBMIT.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 5 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/neon-animation/neon-animated-pages-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animated-pages-extracted.js b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animated-pages-extracted.js
index 596fd73bbfa3d6badec85253855b8e1ad40e06c5..37a4a3f36578d48b2a11b6357d1c157343fef57a 100644
--- a/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animated-pages-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/neon-animation/neon-animated-pages-extracted.js
@@ -37,8 +37,8 @@
_selectedChanged: function(selected) {
var selectedPage = this.selectedItem;
- var oldPage = this._prevSelected || false;
- this._prevSelected = selectedPage;
+ var oldPage = this._valueToItem(this._prevSelected) || false;
+ this._prevSelected = selected;
// on initial load and if animateInitialSelection is negated, simply display selectedPage.
if (!oldPage && !this.animateInitialSelection) {
@@ -105,14 +105,14 @@
// on first load, ensure we run animations only after element is attached.
if (!this.isAttached) {
this.async(function () {
- this.playAnimation(null, {
+ this.playAnimation(undefined, {
fromPage: null,
toPage: selectedPage
});
});
} else {
- this.playAnimation(null, {
+ this.playAnimation(undefined, {
fromPage: oldPage,
toPage: selectedPage
});
@@ -123,6 +123,10 @@
}
},
+ /**
+ * @param {Object=} oldPage
+ * @param {Object=} selectedPage
+ */
_completeSelectedChanged: function(oldPage, selectedPage) {
if (selectedPage) {
selectedPage.classList.remove('neon-animating');
@@ -136,7 +140,7 @@
node.classList && node.classList.remove('neon-animating');
}
}
- this.async(this.notifyResize);
+ this.async(this._notifyPageResize);
},
_onNeonAnimationFinish: function(event) {
@@ -145,6 +149,14 @@
return;
}
this._completeSelectedChanged(event.detail.fromPage, event.detail.toPage);
+ },
+
+ _notifyPageResize: function() {
+ var selectedPage = this.selectedItem;
+ this.resizerShouldNotify = function(element) {
+ return element == selectedPage;
+ }
+ this.notifyResize();
}
})

Powered by Google App Engine
This is Rietveld 408576698