diff --git a/src/compat/env.js b/src/compat/env.js index 65f76e2..713a093 100644 --- a/src/compat/env.js +++ b/src/compat/env.js @@ -392,6 +392,16 @@ Monocle.Env = function () { loadTestFrame(function (fr) { result(fr.parentNode.scrollWidth > testFrameSize); }); + }], + + // For some reason, WebKit on the iPad sometimes loses track of a page after + // slideOut -- it thinks it has an x-translation of 0, rather than -768 or + // whatever. So the page gets "stuck" there, until it is given a non-zero + // x-translation. The workaround is to set a non-zero duration on the jumpIn, + // which seems to force WebKit to recalculate the x of the page. Weird, yeah. + // + ["stickySlideOut", function () { + result(Monocle.Browser.on.iPad); }] ]; diff --git a/src/flippers/slider.js b/src/flippers/slider.js index 951ea01..3923727 100644 --- a/src/flippers/slider.js +++ b/src/flippers/slider.js @@ -409,7 +409,8 @@ Monocle.Flippers.Slider = function (reader) { function jumpIn(pageDiv, callback) { - setX(pageDiv, 0, { duration: 0 }, callback); + opts = { duration: (Monocle.Browser.env.stickySlideOut ? 1 : 0) } + setX(pageDiv, 0, opts, callback); } @@ -441,7 +442,7 @@ Monocle.Flippers.Slider = function (reader) { function slideOpts() { - var opts = { timing: 'ease-in', duration: 300 } + var opts = { timing: 'ease-in', duration: 360 } var now = (new Date()).getTime(); if (p.lastSlide && now - p.lastSlide < 1500) { opts.duration *= 0.5; } p.lastSlide = now;