Connecting WL + publishing author.
[redakcja.git] / src / redakcja / static / js / wiki / caret.js
index 7026e2f..b2cf182 100644 (file)
@@ -30,7 +30,7 @@ class Caret {
             if (!selection.isCollapsed) return;
             var anchorNode = selection.anchorNode;
             // Is selection still inside a node?
             if (!selection.isCollapsed) return;
             var anchorNode = selection.anchorNode;
             // Is selection still inside a node?
-            if (!$(anchorNode).closest('[x-node]')) return;
+            if (!$(anchorNode).closest('[x-node]').length) return;
             
             self.singleClick = true;
             setTimeout(function() {
             
             self.singleClick = true;
             setTimeout(function() {