Skip to content

Commit

Permalink
Metaboxes: Try showing the metaboxes under the editor's content
Browse files Browse the repository at this point in the history
not hiden under a panel
  • Loading branch information
youknowriad committed Oct 31, 2017
1 parent 81328e1 commit 082f6cd
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 16 deletions.
4 changes: 3 additions & 1 deletion editor/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ function Layout( { mode, isSidebarOpened, notices, ...props } ) {
{ mode === 'text' && <TextEditor /> }
{ mode === 'visual' && <VisualEditor /> }
</div>
<MetaBoxes location="normal" />
<div className="editor-layout__metaboxes">
<MetaBoxes location="normal" />
</div>
</div>
{ isSidebarOpened && <Sidebar /> }
<Popover.Slot />
Expand Down
29 changes: 17 additions & 12 deletions editor/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,27 @@

.editor-layout {
position: relative;

.components-notice-list {
position: fixed;
top: 100px;
right: auto;
}
}

.editor-layout__content {
position: relative;
display: flex;
flex-direction: column;
.editor-layout__metaboxes:not(:empty) {
border-top: 1px solid $light-gray-500;
margin-top: 10px;
padding: 10px 0;

.editor-meta-boxes-iframe {
max-width: $visual-editor-max-width;
margin: auto;
}
}

.editor-layout__editor {
flex-basis: 100%;
.editor-layout__content {
position: relative;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}

.editor-layout .components-notice-list {
position: fixed;
top: 100px;
right: auto;
}
10 changes: 8 additions & 2 deletions editor/meta-boxes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ import MetaBoxesIframe from './meta-boxes-iframe';
import MetaBoxesPanel from './meta-boxes-panel';
import { getMetaBox } from '../selectors';

function MetaBox( { location, isActive } ) {
function MetaBox( { location, isActive, usePanel = false } ) {
if ( ! isActive ) {
return null;
}

const element = <MetaBoxesIframe location={ location } />;

if ( ! usePanel ) {
return element;
}

return (
<MetaBoxesPanel>
<MetaBoxesIframe location={ location } />
{ element }
</MetaBoxesPanel>
);
}
Expand Down
2 changes: 1 addition & 1 deletion editor/sidebar/post-settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const panel = (
<DiscussionPanel />
<PageAttributes />
<DocumentOutlinePanel />
<MetaBoxes location="side" />
<MetaBoxes location="side" usePanel />
</Panel>
);

Expand Down

0 comments on commit 082f6cd

Please sign in to comment.