Skip to content

Commit

Permalink
Fix uneditable container delete sometimes not happening especially in…
Browse files Browse the repository at this point in the history
… safari
  • Loading branch information
Oliver Pulges committed Jul 1, 2015
1 parent 43d4971 commit eee73c7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/selection/selection.js
Original file line number Diff line number Diff line change
@@ -529,7 +529,15 @@

if (includePrevLeaves) {
var prevNode = this.getPreviousNode(startNode, true),
prevLeaf = prevNode ? wysihtml5.dom.domNode(prevNode).lastLeafNode() : null;
prevLeaf = null;

if(prevNode) {
if (prevNode.nodeType === 1 && wysihtml5.dom.hasClass(prevNode, this.unselectableClass)) {
prevLeaf = prevNode;
} else {
prevLeaf = wysihtml5.dom.domNode(prevNode).lastLeafNode();
}
}

if (prevLeaf) {
return {

0 comments on commit eee73c7

Please sign in to comment.