-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
…nto feature/editor-control
@westonruter The PR is ready for review. I have tested it with multiple editor controls combinations and did not find any issue. I tried to configure |
label: postTypeObj.labels.content_field ? postTypeObj.labels.content_field : api.Posts.data.l10n.fieldContentLabel, | ||
active: true, | ||
setting_property: 'post_content', | ||
settings: { | ||
'default': setting.id |
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.
I want to see what possibilities there are for eliminating setting_property
in favor of:
settings: {
'default': setting.id + '[post_content]'
}
That would seem more elegant, but I think it will require a core change to support.
… expanded at once
…nto feature/editor-control
* Implement longstanding todo to improve how editor control extends the dynamic control. * Move api.EditorControl to api.Posts.PostEditorControl * Remove need to inject button since now part of template * Eliminate use of propertyElements in favor of directly mutating the setting value. * Eliminate isMeta in favor of being agnostic about what kind of setting is being modified. * Store a reference to the main textarea and re-use.
@sayedwp this is ready for re-review. Could you give it a try with your integration? |
I'll also note that by implementing the expanded interface, expanding an
editor will now work seamlessly with Customizer Browser History,
automatically including the control autofocus param when the control is
expanded.
|
@westonruter Tested with my integration , works beautifully. 👍 |
@westonruter I was just going to say that, and I saw your commit 😄 |
Probably shouldn't increase the overall height any. If the title is within the bar, could maybe some gray borders on either side make it feel more natural? Maybe tabs in the future of we allow more than one editor to be expanded at once. |
Agree on not increasing the overall height. Will add some css to make it look natural. |
@westonruter Is this looking good? The icons shows that its a standard post, as shown in post editor page |
I think the icon should be omitted because the editor can be for any post
type and for any meta now, so it may not make any sense as a thumbtack.
Looks good otherwise!
|
Yes, didn't think of that. And that also makes me think that why you have renamed it to "Post Editor Control" from "Editor Control"? I know it would primarily be used for post content however it would also be used for meta |
@sayedwp good point. I guess the main reason why I went with “Post” editor is that “postmeta” is still specific to posts. Also, there is a specific integration with posts in the control (the control is presumed to be added to a Post section): wp-customize-posts/js/customize-post-editor-control.js Lines 224 to 234 in 4dde895
|
Also, I think there should be a more generic |
That would make more sense. |
@sayedwp cool, once you've pushed up the style changes to the editor title, I think this is good to merge. |
@westonruter Great, lets merge it. |
@sayedwp I did some more cleanup of the JS and added a feature where the new editor heading will only show up if there is more than one editor control in a section. If there is only the content editor control, then there would be no need to disambiguate with other controls in the section. |
@valendesigns the tab is there to give the user context as to what they are editing. It appears when there are multiple editor controls in a given section. @sayedwp would you update the styling to factor in mobile? |
Sure I will update that soon. |
@westonruter I understand why it was added but from a UX perspective it's misleading. It's not a tab at all. It doesn't bind events or navigate to anything. So to clear up context we've introduced confusion elsewhere. I think it would be better if we removed the tab style and just centered the text IMO. Thoughts? |
I guess the idea is that the entire editor could be considered a tab and that's why that style was chosen. @sayedwp can you work out some non-tab styling for the heading? |
No description provided.