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
Comment #2
jefuri commentedI 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.
Comment #3
svenryen commentedDid you try setting the src to += '' (empty string)? That refreshes an iframe.
Comment #4
svenryen commentedIndeed, this patch resolves the issue.
Comment #5
svenryen commentedActually I was wrong. It still jumps to the top.
Comment #6
svenryen commentedHere's a better patch. This one scrolls down again once content has loaded.
Comment #7
svenryen commentedProbably needs some cross browser testing. It works in Chrome.
Comment #9
jefuri commentedFixed, 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.
Comment #10
jefuri commentedThis 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.
Comment #11
jefuri commentedNever mind the form errors. Fixed it as well... As you were... :D
Comment #12
svenryen commentedThanks. Does this call for a 1.0.5 release, or are you planning to add something more?
Comment #13
jefuri commentedDefinitely, so by your request. 1.0.5 released :D.