Skip to content
Snippets Groups Projects
Commit 36b07c2b authored by Christos's avatar Christos
Browse files

Merge branch 'fix-hhmi-issues' into 'master'

Fix hhmi issues

See merge request !421
parents f1c3e888 2aa8855c
No related branches found
No related tags found
1 merge request!421Fix hhmi issues
Showing
with 22 additions and 20 deletions
......@@ -170,7 +170,7 @@ const Hhmi = () => {
value={content}
readonly={readOnly}
layout={HhmiLayout}
onChange={source => console.log(source)}
// onChange={source => console.log(source)}
/>
</>
);
......
import React from 'react'
/* eslint-disable react/prop-types */
import React from 'react';
const DefaultLayout = ({ editor }) => <>{editor}</>
const DefaultLayout = ({ editor }) => <>{editor}</>;
export default DefaultLayout
export default DefaultLayout;
import React from "react";
/* eslint-disable react/jsx-props-no-spreading */
import React from 'react';
export default Component => props => <Component {...props} />;
......@@ -4,7 +4,7 @@
/* eslint-disable react/no-array-index-key */
/* eslint-disable react/destructuring-assignment */
import React, { Component } from 'react';
import { useInjection } from 'wax-prosemirror-core';
import { useInjection } from '../../../../WaxContext';
// eslint-disable-next-line no-unused-vars
class UpdateView extends Component {
......
import Service from '../../../Service';
import { isPlainObject, isFunction } from 'lodash';
import Service from '../../../Service';
import Menu from './Menu';
import MenuCollection from './MenuCollection';
......
/* eslint-disable react/jsx-props-no-spreading */
import React, { useMemo, useContext } from 'react';
import { WaxContext } from 'wax-prosemirror-core';
import { Overlay } from 'wax-prosemirror-components';
import { WaxContext } from '../../../WaxContext';
import usePosition from './usePosition';
export default (Component, markType) => props => {
......
import React, { useContext } from 'react';
import { PortalContext } from 'wax-prosemirror-core';
import ReactDOM from 'react-dom';
// import { isEmpty } from 'lodash';
import { PortalContext } from '../../../../PortalContext';
export default () => {
const { portals } = useContext(PortalContext);
......
/* eslint-disable no-underscore-dangle */
import { Middleware } from 'wax-prosemirror-core';
import { isPlainObject } from 'lodash';
import Middleware from '../../../utilities/lib/Middleware';
import ParseRule from './ParseRule';
export default class Mark {
......
/* eslint-disable no-underscore-dangle */
import { Middleware } from 'wax-prosemirror-core';
import { isPlainObject } from 'lodash';
import Middleware from '../../../utilities/lib/Middleware';
import ParseRule from './ParseRule';
export default class Node {
......
import { Middleware } from 'wax-prosemirror-core';
import { omit } from 'lodash';
import Middleware from '../../../utilities/lib/Middleware';
export default class ParseRule {
tag = null;
......
import Service from '../../../Service';
import { each } from 'lodash';
import Service from '../../../Service';
import Schema from './Schema';
// import Node from './Node';
// import Mark from './Mark';
......
......@@ -139,12 +139,14 @@ export default ({ node, view, getPos }) => {
const listener = event => {
if (event.code === 'Enter') {
event.preventDefault();
addOptionBtnRef.current.click();
if (addOptionBtnRef.current) addOptionBtnRef.current.click();
}
};
addOptionBtnRef.current.addEventListener('keydown', listener);
if (addOptionBtnRef.current)
addOptionBtnRef.current.addEventListener('keydown', listener);
return () => {
addOptionBtnRef.current.removeEventListener('keydown', listener);
if (addOptionBtnRef.current)
addOptionBtnRef.current.removeEventListener('keydown', listener);
};
}, []);
......
......@@ -69,7 +69,7 @@ const CustomSwitch = ({ node, getPos }) => {
});
} else if (
element.type.name === 'multiple_choice_single_correct' &&
element.attrs.correct
element.attrs[key]
) {
tr.setNodeMarkup(parentPosition + position + 1, undefined, {
...element.attrs,
......
......@@ -69,7 +69,7 @@ const CustomSwitch = ({ node, getPos }) => {
});
} else if (
element.type.name === 'true_false_single_correct' &&
element.attrs.correct
element.attrs[key]
) {
tr.setNodeMarkup(parentPosition + position + 1, undefined, {
...element.attrs,
......
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