Skip to content
Snippets Groups Projects
Commit 36f16d82 authored by chris's avatar chris
Browse files

set enable for menuitems

parent a94ada07
No related branches found
No related tags found
1 merge request!38Develop
...@@ -206,7 +206,9 @@ export default { ...@@ -206,7 +206,9 @@ export default {
active: state => { active: state => {
return blockActive(state.config.schema.nodes.blockquote)(state); return blockActive(state.config.schema.nodes.blockquote)(state);
}, },
// enable: wrapIn(schema.nodes.blockquote), enable: state => {
return wrapIn(state.config.schema.nodes.blockquote)(state);
},
run(state, dispatch) { run(state, dispatch) {
wrapIn(state.config.schema.nodes.blockquote)(state, dispatch); wrapIn(state.config.schema.nodes.blockquote)(state, dispatch);
}, },
...@@ -219,7 +221,9 @@ export default { ...@@ -219,7 +221,9 @@ export default {
active: state => { active: state => {
return blockActive(state.config.schema.nodes.bullet_list)(state); return blockActive(state.config.schema.nodes.bullet_list)(state);
}, },
// enable: wrapInList(schema.nodes.bullet_list), enable: state => {
return wrapInList(state.config.schema.nodes.bullet_list)(state);
},
run(state, dispatch) { run(state, dispatch) {
wrapInList(state.config.schema.nodes.bullet_list)(state, dispatch); wrapInList(state.config.schema.nodes.bullet_list)(state, dispatch);
}, },
...@@ -232,7 +236,9 @@ export default { ...@@ -232,7 +236,9 @@ export default {
active: state => { active: state => {
return blockActive(state.config.schema.nodes.ordered_list)(state); return blockActive(state.config.schema.nodes.ordered_list)(state);
}, },
// enable: wrapInList(schema.nodes.ordered_list), enable: state => {
return wrapInList(state.config.schema.nodes.ordered_list)(state);
},
run(state, dispatch) { run(state, dispatch) {
wrapInList(state.config.schema.nodes.ordered_list)(state, dispatch); wrapInList(state.config.schema.nodes.ordered_list)(state, dispatch);
}, },
...@@ -259,7 +265,9 @@ export default { ...@@ -259,7 +265,9 @@ export default {
image: { image: {
title: "Insert image", title: "Insert image",
content: icons.image, content: icons.image,
// enable: canInsert(schema.nodes.image), enable: state => {
return canInsert(state.config.schema.nodes.image)(state);
},
select: state => true, select: state => true,
run: option => true, run: option => true,
menu: props => <ImageUpload key={uuid()} {...props} /> menu: props => <ImageUpload key={uuid()} {...props} />
...@@ -267,7 +275,9 @@ export default { ...@@ -267,7 +275,9 @@ export default {
table: { table: {
title: "Insert table", title: "Insert table",
content: icons.table, content: icons.table,
// enable: canInsert(schema.nodes.table), enable: state => {
return canInsert(state.config.schema.nodes.table)(state);
},
run: (state, dispatch) => { run: (state, dispatch) => {
let rowCount = window && window.prompt("How many rows?", 2); let rowCount = window && window.prompt("How many rows?", 2);
let colCount = window && window.prompt("How many columns?", 2); let colCount = window && window.prompt("How many columns?", 2);
......
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