Browse Source

Check for the anchorNode

pull/1446/head
Artur Arseniev 8 years ago
parent
commit
533738b248
  1. 3
      src/rich_text_editor/model/RichTextEditor.js

3
src/rich_text_editor/model/RichTextEditor.js

@ -38,7 +38,8 @@ const defActions = {
title: 'Link' title: 'Link'
}, },
result: rte => { result: rte => {
const nextSibling = rte.selection().anchorNode.nextSibling; const anchor = rte.selection().anchorNode;
const nextSibling = anchor && anchor.nextSibling;
if (nextSibling && nextSibling.nodeName == 'A') { if (nextSibling && nextSibling.nodeName == 'A') {
rte.exec('unlink'); rte.exec('unlink');
} else { } else {

Loading…
Cancel
Save