From 496b805b37a6f3e7f49e4f1c04abc5416b9a297c Mon Sep 17 00:00:00 2001 From: Josef Brandl Date: Thu, 10 Dec 2015 21:22:23 +0100 Subject: [PATCH] Fix one of the two resize problems described in issue #115 --- neon-animated-pages.html | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) 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(); } - }) })();