diff --git a/neon-animated-pages.html b/neon-animated-pages.html index 6554c01..056c84f 100644 --- a/neon-animated-pages.html +++ b/neon-animated-pages.html @@ -100,6 +100,12 @@ var oldPage = this._valueToItem(this._prevSelected) || false; this._prevSelected = selected; + // send resize notification, so that the page can adapt its size + this.resizerShouldNotify = function(element) { + return element == selectedPage; + } + this.notifyResize(); + // on initial load and if animateInitialSelection is negated, simply display selectedPage. if (!oldPage && !this.animateInitialSelection) { this._completeSelectedChanged(); @@ -201,7 +207,6 @@ node.classList && node.classList.remove('neon-animating'); } } - this.async(this._notifyPageResize); }, _onNeonAnimationFinish: function(event) { @@ -210,16 +215,7 @@ return; } this._completeSelectedChanged(event.detail.fromPage, event.detail.toPage); - }, - - _notifyPageResize: function() { - var selectedPage = this.selectedItem; - this.resizerShouldNotify = function(element) { - return element == selectedPage; - } - this.notifyResize(); } - }) })();