From 6f995a7ea1f35632fa54ad007953377bdf119c3a Mon Sep 17 00:00:00 2001 From: François Frisch Date: Wed, 21 Mar 2012 11:48:30 -0700 Subject: Flow doesn't reset to origin 0 when changing the feed --- .../montage/ui/picasa-carousel.reel/picasa-carousel.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'node_modules/montage') diff --git a/node_modules/montage/ui/picasa-carousel.reel/picasa-carousel.js b/node_modules/montage/ui/picasa-carousel.reel/picasa-carousel.js index b41df9a6..bdc74c83 100644 --- a/node_modules/montage/ui/picasa-carousel.reel/picasa-carousel.js +++ b/node_modules/montage/ui/picasa-carousel.reel/picasa-carousel.js @@ -111,10 +111,17 @@ var PicasaCarousel = exports.PicasaCarousel = Montage.create(Component, /** @len handleSearchRequestLoad: { value: function(evt) { - var response = JSON.parse(evt.target.responseText); + var response = JSON.parse(evt.target.responseText), + previousOrigin = this.flow.origin; this.searchResults = response.feed.entry; - this.flow.length = this.initialPosition; - this.flow.origin = this.initialPosition; + if (this.flow.length === 0) { + this.flow.length = this.initialPosition; + } + if (previousOrigin === 0) { + this.flow.origin = this.initialPosition; + } else { + this.flow.origin = previousOrigin; + } this.isSearching = false; } }, -- cgit v1.2.3