-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Meta Boxes: Allow collapsing/sorting the meta boxes panels #4434
Conversation
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.
Noting that this uses a different persistence mechanism than the reducer preferences, so if one is cleared and the other not, some but not all "preferences" will be reset. I think it's fine enough for now.
editor/store/effects.js
Outdated
@@ -452,4 +452,10 @@ export default { | |||
const message = spokenMessage || content; | |||
speak( message, 'assertive' ); | |||
}, | |||
INITIALIZE_META_BOX_STATE( action ) { | |||
// Allow toggeling metaboxes panels |
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.
Typo: "toggeling" -> "toggling"
editor/store/effects.js
Outdated
@@ -452,4 +452,10 @@ export default { | |||
const message = spokenMessage || content; | |||
speak( message, 'assertive' ); | |||
}, | |||
INITIALIZE_META_BOX_STATE( action ) { | |||
// Allow toggeling metaboxes panels | |||
if ( some( action.metaBoxes ) ) { |
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.
Minor: some
is reasonable enough; isEmpty
is maybe a bit more accurate to what you're testing, particularly since you're not providing a predicate for some
.
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.
Actually, isEmpty doesn't work here because it's an object like this { side: true, normal: false }
. isEmpty always returns false in this case.
9d060bf
to
b47bc41
Compare
I merged this PR into my development system and all the problems I mentioned in #4532 have been resolved. |
Travis is down for a long time now, I'm going to merge. Unit tests pass locally. |
This PR enables the meta boxes collapsing/sorting behavior we have in the classic editor.
It's as simple as calling
window.postboxes.add_postbox_toggles( 'post' );
when we load the meta boxes.Testing instructions