fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Connecting WL + publishing author.
[redakcja.git]
/
src
/
redakcja
/
static
/
js
/
wiki
/
caret.js
diff --git
a/src/redakcja/static/js/wiki/caret.js
b/src/redakcja/static/js/wiki/caret.js
index
8b3cbd8
..
b2cf182
100644
(file)
--- a/
src/redakcja/static/js/wiki/caret.js
+++ b/
src/redakcja/static/js/wiki/caret.js
@@
-28,12
+28,15
@@
class Caret {
var selection = window.getSelection();
if (!selection.isCollapsed) return;
var selection = window.getSelection();
if (!selection.isCollapsed) return;
+ var anchorNode = selection.anchorNode;
+ // Is selection still inside a node?
+ if (!$(anchorNode).closest('[x-node]').length) return;
self.singleClick = true;
setTimeout(function() {
if (self.singleClick) {
self.element.insertBefore(
self.singleClick = true;
setTimeout(function() {
if (self.singleClick) {
self.element.insertBefore(
-
selection.
anchorNode.splitText(
+ anchorNode.splitText(
selection.anchorOffset
)
)
selection.anchorOffset
)
)