Skip to content

Commit

Permalink
Meta Boxes: Allow collapsing/sorting the meta boxes panels
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jan 17, 2018
1 parent 8d3a673 commit 47c36a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion editor/store/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { BEGIN, COMMIT, REVERT } from 'redux-optimist';
import { get, includes, map, castArray, uniqueId } from 'lodash';
import { get, includes, map, castArray, uniqueId, some } from 'lodash';

/**
* WordPress dependencies
Expand Down Expand Up @@ -452,4 +452,10 @@ export default {
const message = spokenMessage || content;
speak( message, 'assertive' );
},
INITIALIZE_META_BOX_STATE( action ) {
// Allow toggling metaboxes panels
if ( some( action.metaBoxes ) ) {
window.postboxes.add_postbox_toggles( 'post' );
}
},
};
2 changes: 1 addition & 1 deletion lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ function gutenberg_editor_scripts_and_styles( $hook ) {
wp_enqueue_script(
'wp-editor',
gutenberg_url( 'editor/build/index.js' ),
array( 'jquery', 'wp-api', 'wp-data', 'wp-date', 'wp-i18n', 'wp-blocks', 'wp-element', 'wp-components', 'wp-utils', 'word-count', 'editor', 'heartbeat' ),
array( 'postbox', 'jquery', 'wp-api', 'wp-data', 'wp-date', 'wp-i18n', 'wp-blocks', 'wp-element', 'wp-components', 'wp-utils', 'word-count', 'editor', 'heartbeat' ),
filemtime( gutenberg_dir_path() . 'editor/build/index.js' ),
true // enqueue in the footer.
);
Expand Down

0 comments on commit 47c36a5

Please sign in to comment.