Skip to content
Snippets Groups Projects
Commit 5992cebf authored by chris's avatar chris
Browse files

fix

parent 7f35d848
No related branches found
No related tags found
1 merge request!293Inline question
...@@ -54,7 +54,7 @@ const Editors = () => { ...@@ -54,7 +54,7 @@ const Editors = () => {
case 'ncbi': case 'ncbi':
break; break;
default: default:
return <HHMI />; return <Editoria />;
} }
}; };
......
...@@ -185,7 +185,7 @@ const Hhmi = () => { ...@@ -185,7 +185,7 @@ const Hhmi = () => {
fileUpload={file => renderImage(file)} fileUpload={file => renderImage(file)}
value={initialValue} value={initialValue}
targetFormat="JSON" targetFormat="JSON"
readonly // readonly
layout={HhmiLayout} layout={HhmiLayout}
onChange={source => console.log(source)} onChange={source => console.log(source)}
/> />
......
...@@ -18,6 +18,13 @@ const EditorComponent = ({ node, view, getPos }) => { ...@@ -18,6 +18,13 @@ const EditorComponent = ({ node, view, getPos }) => {
const isEditable = context.view.main.props.editable(editable => { const isEditable = context.view.main.props.editable(editable => {
return editable; return editable;
}); });
console.log(context.activeViewId);
console.log('node', node.attrs.id);
if (context.activeViewId === node.attrs.id) {
console.log('sss');
}
useEffect(() => { useEffect(() => {
questionView = new EditorView( questionView = new EditorView(
{ mount: editorRef.current }, { mount: editorRef.current },
...@@ -38,6 +45,11 @@ const EditorComponent = ({ node, view, getPos }) => { ...@@ -38,6 +45,11 @@ const EditorComponent = ({ node, view, getPos }) => {
if (questionView.hasFocus()) questionView.focus(); if (questionView.hasFocus()) questionView.focus();
}, },
}, },
handleKeyDown: (editoView, keyEvent) => {
if (keyEvent.key === 'Enter') {
console.log('create new');
}
},
attributes: { attributes: {
spellcheck: 'false', spellcheck: 'false',
......
...@@ -40,7 +40,7 @@ export default props => { ...@@ -40,7 +40,7 @@ export default props => {
}); });
}, },
}); });
console.log(portal);
return ( return (
<PortalContext.Provider <PortalContext.Provider
value={{ value={{
......
...@@ -23,9 +23,8 @@ class PortalService extends Service { ...@@ -23,9 +23,8 @@ class PortalService extends Service {
this.container.bind('AddPortal').toFactory(context => { this.container.bind('AddPortal').toFactory(context => {
return portal => { return portal => {
const schemaInstance = context.container.get('Portals'); const portalInstance = context.container.get('Portals');
portalInstance.addPortal(portal);
schemaInstance.addPortal(portal);
}; };
}); });
} }
......
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