Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
ckeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vanilla ckeditor-3.4b
[ckeditor.git]
/
_source
/
plugins
/
enterkey
/
plugin.js
diff --git
a/_source/plugins/enterkey/plugin.js
b/_source/plugins/enterkey/plugin.js
index
10b7e62
..
f383fb4
100644
(file)
--- a/
_source/plugins/enterkey/plugin.js
+++ b/
_source/plugins/enterkey/plugin.js
@@
-24,6
+24,11
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
// Get the range for the current selection.
\r
range = range || getRange( editor );
\r
\r
// Get the range for the current selection.
\r
range = range || getRange( editor );
\r
\r
+ // We may not have valid ranges to work on, like when inside a
\r
+ // contenteditable=false element.
\r
+ if ( !range )
\r
+ return;
\r
+
\r
var doc = range.document;
\r
\r
// Exit the list when we're inside an empty list item block. (#5376)
\r
var doc = range.document;
\r
\r
// Exit the list when we're inside an empty list item block. (#5376)
\r
@@
-189,6
+194,11
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
// Get the range for the current selection.
\r
range = range || getRange( editor );
\r
\r
// Get the range for the current selection.
\r
range = range || getRange( editor );
\r
\r
+ // We may not have valid ranges to work on, like when inside a
\r
+ // contenteditable=false element.
\r
+ if ( !range )
\r
+ return;
\r
+
\r
var doc = range.document;
\r
\r
// Determine the block element to be used.
\r
var doc = range.document;
\r
\r
// Determine the block element to be used.
\r
@@
-339,7
+349,7
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
function getRange( editor )
\r
{
\r
// Get the selection ranges.
\r
function getRange( editor )
\r
{
\r
// Get the selection ranges.
\r
- var ranges = editor.getSelection().getRanges();
\r
+ var ranges = editor.getSelection().getRanges( true );
\r
\r
// Delete the contents of all ranges except the first one.
\r
for ( var i = ranges.length - 1 ; i > 0 ; i-- )
\r
\r
// Delete the contents of all ranges except the first one.
\r
for ( var i = ranges.length - 1 ; i > 0 ; i-- )
\r