Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

When editing a post, make sure the corresponding partial is scrolled into view #37

Open
westonruter opened this issue Mar 4, 2016 · 2 comments
Assignees

Comments

@westonruter
Copy link
Contributor

westonruter commented Mar 4, 2016

See https://core.trac.wordpress.org/ticket/39389

@westonruter
Copy link
Contributor Author

This could be implemented in the JS Partial instances themselves. When refreshing any partial, it could call Element.scrollIntoView().

@kienstra kienstra self-assigned this Aug 16, 2016
kienstra pushed a commit that referenced this issue Aug 16, 2016
Editing a post field will trigger a refresh of its partial.
In the refresh() method, define and call scrollPartialToTopOfPage.
Some themes have a margin-top of the #page element, like 2016.
And this scrolling would hide part of the partial.
So also calculate the offsetTop of #page, to prevent this.
If this isn't a concern, this commit could be much simpler.
@westonruter
Copy link
Contributor Author

This is something that should be in core generally, so I've also prepared a patch for a new trac ticket I opened: https://core.trac.wordpress.org/ticket/39389

@kienstra The patch could be applied to #220 for the deferred partial.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants