fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactoring
[fnpeditor.git]
/
modules
/
documentCanvas
/
canvasManager.js
diff --git
a/modules/documentCanvas/canvasManager.js
b/modules/documentCanvas/canvasManager.js
index
aa37ff2
..
b7e7212
100644
(file)
--- a/
modules/documentCanvas/canvasManager.js
+++ b/
modules/documentCanvas/canvasManager.js
@@
-109,13
+109,20
@@
Manager.prototype.insertNewNode = function(wlxmlTag, wlxmlClass) {
offsetStart = offsetEnd;
\r
offsetEnd = tmp;
\r
}
\r
offsetStart = offsetEnd;
\r
offsetEnd = tmp;
\r
}
\r
+
\r
+
\r
var wrapper = canvasNode.create({tag: wlxmlTag, klass: wlxmlClass});
\r
var parent = $(selection.anchorNode).parent();
\r
var wrapper = canvasNode.create({tag: wlxmlTag, klass: wlxmlClass});
\r
var parent = $(selection.anchorNode).parent();
\r
+
\r
+ var textNodeIdx = parent.contents().index($(selection.anchorNode));
\r
+ if(selection.anchorNode != selection.focusNode) {
\r
+ textNodeIdx = [textNodeIdx, parent.contents().index($(selection.focusNode))];
\r
+ }
\r
this.canvas.nodeWrap({inside: canvasNode.create(parent),
\r
_with: wrapper,
\r
offsetStart: offsetStart,
\r
offsetEnd: offsetEnd,
\r
this.canvas.nodeWrap({inside: canvasNode.create(parent),
\r
_with: wrapper,
\r
offsetStart: offsetStart,
\r
offsetEnd: offsetEnd,
\r
- textNodeIdx:
parent.contents().index($(selection.anchorNode))
\r
+ textNodeIdx:
textNodeIdx
\r
});
\r
this.selectNode(wrapper, {movecaret: 'end'});
\r
}
\r
});
\r
this.selectNode(wrapper, {movecaret: 'end'});
\r
}
\r