fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
editor: Missing exercise actions
[fnpeditor.git]
/
src
/
editor
/
plugins
/
core
/
lists.js
diff --git
a/src/editor/plugins/core/lists.js
b/src/editor/plugins/core/lists.js
index
662dc53
..
c6de730
100644
(file)
--- a/
src/editor/plugins/core/lists.js
+++ b/
src/editor/plugins/core/lists.js
@@
-12,6
+12,10
@@
var getBoundriesForAList = function(fragment) {
}
if(fragment instanceof fragment.NodeFragment) {
node = fragment.node.getNearestElementNode();
}
if(fragment instanceof fragment.NodeFragment) {
node = fragment.node.getNearestElementNode();
+ if(node.isContextRoot()) {
+ node = fragment.node;
+ }
+
return {
node1: node,
node2: node
return {
node1: node,
node2: node
@@
-45,8
+49,9
@@
var toggleListAction = function(type) {
item1 = list.object.getItem(0),
text = item1 ? item1.contents()[0] : undefined, //
doc = boundries.node1.document;
item1 = list.object.getItem(0),
text = item1 ? item1.contents()[0] : undefined, //
doc = boundries.node1.document;
-
- return doc.createFragment(doc.CaretFragment, {node: text, offset:0});
+ if(text) {
+ return doc.createFragment(doc.CaretFragment, {node: text, offset:0});
+ }
}, {
metadata: {
description: action.getState().description,
}, {
metadata: {
description: action.getState().description,