-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ScrollSync Button to Preview UI #693
Conversation
Sorry, should have waited until #659 was merged. |
Thanks @Jinksi! I want to improve the arch on this, mostly just creating a single toggle component and reusing that, and avoiding the universal selector in CSS. If you have time to handle that and that rebase we can get this in sooner, otherwise I or another contributor will get to it. |
@erquhart No problem, I'll get onto it |
Sorry, looks like I messed up the rebase |
Rebase fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Just a few changes and this is good to go. This improvement did get our control panel buttons to a place where they merit a separate component, that's worth doing in the future.
I'll also note for any other reviewers that this is only necessary because our scroll syncing is very simplistic. The real fix is to make it more robust, but that'll take some doing, and no one is working on it at the moment. Just know that we're not throwing in the towel on that.
@@ -51,6 +52,7 @@ export default class ScrollSync extends Component { | |||
}; | |||
|
|||
handlePaneScroll = (node) => { | |||
if (!this.props.enabled) return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add semi-colon at line end.
@@ -6,6 +6,7 @@ export default class ScrollSync extends Component { | |||
|
|||
static propTypes = { | |||
children: PropTypes.element.isRequired, | |||
enabled: PropTypes.bool.isRequired |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add trailing comma to last item in a collection.
<div className="nc-entryEditor-controlPaneButtons"> | ||
{ previewVisible && ( | ||
<ToggleButton | ||
icon={scrollSyncEnabled ? 'sync_disabled' : 'sync'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need to be swapped, currently shows the disabled icon when scrolling is enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The icon used here looks like a refresh button to me, but that's fine for now if we change it before the UI refresh. Other than that LGTM.
* Add ScrollSync Button * Create <ToggleButton /> component && update CSS * Swap Icons && fix formatting
Closes #532
- Summary
sync
andsync-disabled
icon- Test plan
Manually tested UI (see screen capture). If I should be adding formal tests, please let me know.
- Description for the changelog
Added button to toggle preview scroll-sync.
- A picture of a cute animal (not mandatory but encouraged)