Skip to content

Commit

Permalink
apparently className isn't passed to save
Browse files Browse the repository at this point in the history
Fixes #7
  • Loading branch information
afragen committed Dec 19, 2018
1 parent b18afa5 commit c7e6d52
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion blocks/index.build.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions blocks/index.js
@@ -1,7 +1,7 @@
import classnames from 'classnames';

const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const { registerBlockType, getBlockDefaultClassName } = wp.blocks;
const { RichText, MediaPlaceholder, MediaUpload, InspectorControls, BlockControls, BlockAlignmentToolbar } = wp.editor;
const { Fragment } = wp.element;
const { withNotices, IconButton, TextControl, PanelBody, Toolbar, ResizableBox } = wp.components;
Expand All @@ -11,13 +11,15 @@ const { isBlobURL } = wp.blob;
const isExternalPDF = (id, url) => url && !id && !isBlobURL(url);

const renderEmbed = (props) => {
const { attributes: { url, width, height }, className } = props;
const { attributes: { url, width, height } } = props;
const style = { width, height };
const myClassName = getBlockDefaultClassName('embed-pdf-viewer/embed-pdf-viewer');

if (undefined === url || !url) {
return null;
}
return (
<figure className={`${className}__content-wrapper`}>
<figure className={`${myClassName}__content-wrapper`}>
<object
className="embed-pdf-viewer"
data={url + '#scrollbar=1&toolbar=1'}
Expand Down
2 changes: 1 addition & 1 deletion embed-pdf-viewer.php
Expand Up @@ -5,7 +5,7 @@
* Description: Embed a PDF from the Media Library or elsewhere via oEmbed or as a block into an `object` tag or Google Doc Viewer as fallback.
* Author: Andy Fragen
* Author URI: https://github.com/afragen
* Version: 1.6.1.4
* Version: 1.6.1.5
* License: GPLv2+
* Domain Path: /languages
* Text Domain: embed-pdf-viewer
Expand Down

0 comments on commit c7e6d52

Please sign in to comment.