Skip to content

Commit

Permalink
fix: container selectors not used
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchappell committed Jun 19, 2019
1 parent 127fe13 commit 73abb52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/demo/js/options/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import config from './config'
import { devPrefix } from '../../../../tools/build-vars'

const editorContainer = document.querySelector('.build-form')
const renderContainer = document.querySelector('.render-form')
const renderContainer = '.render-form'

export const editorOptions = {
editorContainer,
Expand Down
6 changes: 4 additions & 2 deletions src/js/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import { STAGE_CLASSNAME, UUID_REGEXP } from './constants'

const RENDER_PREFIX = 'f-'

const processOptions = ({ container, ...opts }) => {
const processOptions = ({ editorContainer, renderContainer, ...opts }) => {
const containerLookup = container => (typeof container === 'string' ? document.querySelector(container) : container)
const processedOptions = {
container: typeof container === 'string' ? document.querySelector(container) : container,
renderContainer: containerLookup(renderContainer),
editorContainer: containerLookup(editorContainer),
}

return Object.assign({}, opts, processedOptions)
Expand Down

0 comments on commit 73abb52

Please sign in to comment.