1 | Index:_source/plugins/wysiwygarea/plugin.js |
---|
2 | =================================================================== |
---|
3 | --- _source/plugins/wysiwygarea/plugin.js (version 3.6.2) |
---|
4 | +++ _source/plugins/wysiwygarea/plugin.js (working copy) |
---|
5 | @@ -802,10 +802,11 @@ |
---|
6 | { |
---|
7 | domDocument.on( 'selectionchange', function() |
---|
8 | { |
---|
9 | - var body = domDocument.getBody(), |
---|
10 | + var range= null, body = domDocument.getBody(); |
---|
11 | + if (editor != null && editor.getSelection() != null) { |
---|
12 | range = editor.getSelection().getRanges()[ 0 ]; |
---|
13 | - |
---|
14 | - if ( body.getHtml().match( /^<p> <\/p>$/i ) |
---|
15 | + } |
---|
16 | + if ( range && body.getHtml().match( /^<p> <\/p>$/i ) |
---|
17 | && range.startContainer.equals( body ) ) |
---|
18 | { |
---|
19 | // Avoid the ambiguity from a real user cursor position. |
---|