[FIX] website: better text node if delete and whitespace

If the node is a text node containing only empty space, we must replace
some of these space by an   so it can be selected.
This commit is contained in:
Nicolas Lempereur
2015-09-04 11:35:11 +02:00
parent 1992043686
commit 6672e45ba4
+2 -2
View File
@@ -595,9 +595,9 @@ define(['summernote/editing/Editor', 'summernote/summernote'], function (Editor)
sc = $("<br/>")[0];
so = 0;
$(ancestor).prepend(sc);
} else if (before) {
} else if (dom.isText(sc)) {
var text = sc.textContent.replace(/[ \t\n\r]+$/, '\u00A0');
so -= sc.textContent.length - text.length;
so = Math.min(so, text.length);
sc.textContent = text;
}