Commit 88eeae00 authored by chris's avatar chris

cleanup

parent 2e1559e6
......@@ -101,7 +101,6 @@ class Wax extends Component {
options={this.WaxOptions}
placeholder={placeholder}
fileUpload={fileUpload}
// renderLayout={WaxRender}
theme={theme}
onBlur={onBlur || (value => true)}
onChange={this.onChange || (value => true)}
......
......@@ -11,9 +11,9 @@ import "prosemirror-gapcursor/style/gapcursor.css";
class WaxView extends Component {
constructor(props) {
super(props);
const {readonly, onBlur } = this.props;
const { readonly, onBlur } = this.props;
this.editorRef = React.createRef()
this.editorRef = React.createRef();
// Create view of Editor
this.view = new EditorView(null, {
......@@ -33,7 +33,7 @@ class WaxView extends Component {
componentDidMount() {
const { autoFocus, debug } = this.props;
this.editorRef.current.appendChild(this.view.dom)
this.editorRef.current.appendChild(this.view.dom);
if (debug) applyDevTools(this.view);
if (autoFocus) this.view.focus();
......@@ -54,7 +54,7 @@ class WaxView extends Component {
tr.setMeta(placeholderPlugin, {
add: { id, pos: tr.selection.from }
});
this.view.dispatch(tr);
fileUpload(file).then(
......@@ -88,7 +88,6 @@ class WaxView extends Component {
findPlaceholder = (state, id) => {
const decos = placeholderPlugin.getState(state);
debugger;
const found = decos.find(null, null, spec => spec.id === id);
return found.length ? found[0].from : null;
};
......@@ -97,7 +96,7 @@ class WaxView extends Component {
const state = this.view.state.apply(transaction);
this.view.updateState(state);
this.props.onChange(state.doc.content);
this.forceUpdate()
this.forceUpdate();
};
render() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment