Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

load random featured MP with js on page load #309

Closed
davewhiteland opened this Issue · 1 comment

1 participant

@davewhiteland

Currently hoe template loads with a random MP, but our caching is (rightly) not pushing it out to every request.
On page load js could pull in a random MP

@davewhiteland davewhiteland was assigned
@davewhiteland

Implemented with #310 -- that is, this only happens auto_advance_enabled = true;
Since this is an AJAX load on document-ready, there is likely to be a flicker of the initial content.
One way to avoid the flicker is to randomly load the next featured person after the auto_advance_delay (say, 12 seconds) but this doesn't really solve the problem of always seeing the same featured person from the server-side cache. This would avoid the flicker of the featured MP reloading as soon as the page loads but it would break the prev/next behaviour within the featured_person box -- that is, the user clicking the "back" chevron wouldn't get back to the person they had just seen, and that seems unacceptable breakage. But maybe others will judge differently.
So: enable locally to see how this plays out and make a decision on whether to call the initial load immediately (which is currently the case) or else on a setTimeout.
code where this happens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.