[FIX] website editor: delete content should not remove the editable ancestor node when all content is seleted

This commit is contained in:
Christophe Matthieu
2015-03-23 12:25:06 +01:00
parent 2f5e4149fb
commit c9dd223305
+6 -1
View File
@@ -524,7 +524,12 @@ define(['summernote/editing/Editor', 'summernote/summernote'], function (Editor)
};
}
if (ancestor.tagName) {
if (dom.isEditable(ancestor)) {
sc = $("<br/>")[0];
so = 0;
$(ancestor).html(sc);
} else if (ancestor.tagName) {
var ancestor_sc = sc;
var ancestor_ec = ec;
while (ancestor !== ancestor_sc && ancestor !== ancestor_sc.parentNode) { ancestor_sc = ancestor_sc.parentNode; }