Problem/Motivation

Thanks again for this really nice module, we're already adding it to several of our sites! One thing we notice, though, which we hope can be improved is the scroll position. If you've scrolled down on the preview page, and then change a value in the edit form, the current location goes back to the top when the preview reloads. Hope that can be improved.

Steps to reproduce

Proposed resolution

It should be possible to read the scroll of the preview iframe before the preview updates, and reapply the scroll position once the iframe has finished loading. Let me know if you want a hand with this task :)

Remaining tasks

User interface changes

API changes

Data model changes

Comments

svenryen created an issue. See original summary.

jefuri’s picture

Status: Active » Postponed (maintainer needs more info)

I think it might be possible if could refresh the iframe somehow, instead of replacing the whole iframe element.
Don't know yet how though. And ofcourse, keeping the scroll position within the iframe intact.

svenryen’s picture

Did you try setting the src to += '' (empty string)? That refreshes an iframe.

svenryen’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new461 bytes

Indeed, this patch resolves the issue.

svenryen’s picture

Status: Needs review » Needs work

Actually I was wrong. It still jumps to the top.

svenryen’s picture

Here's a better patch. This one scrolls down again once content has loaded.

svenryen’s picture

Probably needs some cross browser testing. It works in Chrome.

  • jefuri committed e5ec260 on 1.0.x authored by svenryen
    Issue #3168492 by svenryen: When you've scrolled down in the preview,...
jefuri’s picture

Status: Needs review » Fixed

Fixed, improved some js while doing so.

If you have time. I have another issue you could look at.
Already have a first draft in dev. It's about form errors.

jefuri’s picture

Status: Fixed » Closed (fixed)

This works in firefox as well btw, haven't tested it with others. But added a try catch to hopefully prevent issues with it. Will see if we have more issues with it later.

jefuri’s picture

Never mind the form errors. Fixed it as well... As you were... :D

svenryen’s picture

Thanks. Does this call for a 1.0.5 release, or are you planning to add something more?

jefuri’s picture

Definitely, so by your request. 1.0.5 released :D.