Skip to content

Commit

Permalink
Metaboxes: Remove lingering useless code or mentions of iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Nov 13, 2017
1 parent 5115f4f commit e7cf969
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 134 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ build
coverage
vendor
node_modules
/assets/js
1 change: 0 additions & 1 deletion bin/build-plugin-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ mv gutenberg.tmp.php gutenberg.php
status "Creating archive..."
zip -r gutenberg.zip \
gutenberg.php \
assets/js/*.js \
lib/*.php \
blocks/library/*/*.php \
post-content.js \
Expand Down
4 changes: 2 additions & 2 deletions docs/meta-box.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ this might now be possible. Test with ACF to make sure.
`INITIALIZE_META_BOX_STATE` comes in, the store will update any active meta box
areas by setting the `isActive` flag to `true`. Once this happens React will
check for the new props sent in by Redux on the `MetaBox` component. If that
`MetaBox` is now active, instead of rendering null, a `MetaBoxIframe` component will
`MetaBox` is now active, instead of rendering null, a `MetaBoxArea` component will
be rendered. The `MetaBox` component is the container component that mediates
between the `MetaBoxIframe` and the Redux Store. *If no meta boxes are active,
between the `MetaBoxArea` and the Redux Store. *If no meta boxes are active,
nothing happens. This will be the default behavior, as all core meta boxes have
been stripped.*

Expand Down
1 change: 0 additions & 1 deletion editor/components/meta-boxes/meta-boxes-area/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { Spinner } from '@wordpress/components';
* Internal dependencies
*/
import './style.scss';
import './meta-box-area.scss';
import { handleMetaBoxReload, metaBoxStateChanged, metaBoxLoaded } from '../../actions';
import { getMetaBox, isSavingPost } from '../../selectors';

Expand Down
93 changes: 0 additions & 93 deletions editor/components/meta-boxes/meta-boxes-area/meta-box-area.scss

This file was deleted.

108 changes: 82 additions & 26 deletions editor/components/meta-boxes/meta-boxes-area/style.scss
Original file line number Diff line number Diff line change
@@ -1,37 +1,93 @@
.editor-meta-boxes-iframe {
width: 100%;

.editor-meta-boxes-area {
position: relative;

.is-updating {
filter: blur( 5px );
/* Match width and positioning of the meta boxes. Override default styles. */
#poststuff {
margin: 0 auto;
padding-top: 0;
min-width: auto;
}

#post {
margin: 0;
}

/* Override Default meta box stylings */

#poststuff h3.hndle,
#poststuff .stuffbox > h3,
#poststuff h2.hndle { /* WordPress selectors yolo */
border-bottom: 1px solid $light-gray-500;
box-sizing: border-box;
color: $dark-gray-500;
font-weight: 600;
outline: none;
padding: 15px;
position: relative;
width: 100%;
}

.postbox {
border: 0;
color: $dark-gray-500;
margin-bottom: 0;
}

.postbox > .inside {
border-bottom: 1px solid $light-gray-500;
color: $dark-gray-500;
padding: 15px;
margin: 0;
}

input {
max-width: 300px;
}

input,
select,
textarea {
background: inherit;
border: 1px solid $light-gray-500;
border-radius: 4px;
box-shadow: none;
color: $dark-gray-800;
display: inline-block;
font-family: inherit;
font-size: 13px;
line-height: 24px;
outline: none;
padding: 4px;
}

.is-hidden {
visibility: hidden;
input:hover,
select:hover,
textarea:hover {
border: 1px solid $light-gray-700;
}

.postbox .handlediv {
height: 44px;
width: 44px;
}

&.is-loading:before {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
content: '';
z-index: 1;
background: transparent;
z-index: z-index( '.editor-meta-boxes-area.is-loading:before');
}
}

.editor-meta-boxes-iframe__loading-overlay {
background-color: rgba( 0, 0, 0, 0.6 );
display: none;
position: absolute;
height: 100%;
top: 0;
left: 0;
width: 100%;
z-index: 1;

&.is-visible {
align-items: center;
display: flex;
justify-content: center;
.spinner {
position: absolute;
top: 10px;
right: 20px;
z-index: z-index( '.editor-meta-boxes-area .spinner');
}
}

.editor-meta-boxes-iframe__loading-overlay-text {
color: $white;
font-weight: 700;
}
3 changes: 0 additions & 3 deletions editor/components/meta-boxes/meta-boxes-panel/style.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
* These are the styles that are not loaded from within the iframe.
*/
.editor-meta-boxes-panel {
border: 0;

Expand Down
8 changes: 1 addition & 7 deletions lib/meta-box-partial-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ function gutenberg_meta_box_partial_page_admin_header( $hook_suffix, $current_sc
wp_enqueue_script( 'common' );
wp_enqueue_script( 'svg-painter' );
?>
<!-- Add an html class so that scroll bars can be removed in css and make it appear as though the iframe is one with Gutenberg. -->
<html class="gutenberg-meta-box-html">
<html>
<head>
<?php
// Grab the admin body class.
Expand Down Expand Up @@ -368,7 +367,6 @@ function gutenberg_meta_box_partial_page_post_form( $post, $location ) {
*/
?>
<div id="poststuff" class="sidebar-open">
<div><!-- THIS IS SOMEHOW REALLY IMPORTANT FOR IFRAMES TO RESIZE CORRECTLY -->
<div id="postbox-container-2" class="postbox-container">
<?php
}
Expand All @@ -381,10 +379,6 @@ function gutenberg_meta_box_partial_page_post_form( $post, $location ) {
* @param string $hook_suffix The hook suffix of the current page.
*/
function gutenberg_meta_box_partial_page_admin_footer( $hook_suffix ) {
?>
</div><!-- END of important resize div. -->
<?php

/**
* Prints scripts or data before the default footer scripts.
*
Expand Down

0 comments on commit e7cf969

Please sign in to comment.